Index: third_party/libaddressinput/chromium/trie.h |
diff --git a/third_party/libaddressinput/chromium/cpp/src/util/trie.h b/third_party/libaddressinput/chromium/trie.h |
similarity index 62% |
copy from third_party/libaddressinput/chromium/cpp/src/util/trie.h |
copy to third_party/libaddressinput/chromium/trie.h |
index 6b1792b98733cce0350f863bc3270a308208ce5c..e3cbe6d90dadb12ec537cd2f2725da7bc67c7e5a 100644 |
--- a/third_party/libaddressinput/chromium/cpp/src/util/trie.h |
+++ b/third_party/libaddressinput/chromium/trie.h |
@@ -1,29 +1,18 @@ |
-// Copyright (C) 2014 Google Inc. |
-// |
-// Licensed under the Apache License, Version 2.0 (the "License"); |
-// you may not use this file except in compliance with the License. |
-// You may obtain a copy of the License at |
-// |
-// http://www.apache.org/licenses/LICENSE-2.0 |
-// |
-// Unless required by applicable law or agreed to in writing, software |
-// distributed under the License is distributed on an "AS IS" BASIS, |
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
-// See the License for the specific language governing permissions and |
-// limitations under the License. |
- |
-#ifndef I18N_ADDRESSINPUT_UTIL_TRIE_H_ |
-#define I18N_ADDRESSINPUT_UTIL_TRIE_H_ |
+// Copyright 2014 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
-#include <libaddressinput/util/basictypes.h> |
+#ifndef THIRD_PARTY_LIBADDRESSINPUT_CHROMIUM_TRIE_H_ |
+#define THIRD_PARTY_LIBADDRESSINPUT_CHROMIUM_TRIE_H_ |
#include <list> |
#include <map> |
#include <set> |
#include <string> |
-namespace i18n { |
-namespace addressinput { |
+#include "base/basictypes.h" |
+ |
+namespace autofill { |
// A prefix search tree. Can return all objects whose keys start with a prefix |
// string. |
@@ -36,9 +25,11 @@ template <typename T> |
class Trie { |
public: |
Trie(); |
- |
~Trie(); |
+ // Returns true if no data was added in AddDataForKey(). |
+ bool empty() const { return data_list_.empty() && sub_nodes_.empty(); } |
+ |
// Adds a mapping from |key| to |data_item|. Can be called with the same |key| |
// multiple times. |
void AddDataForKey(const std::string& key, const T& data_item); |
Evan Stade
2014/06/27 22:44:37
this was a netter api
please use gerrit instead
2014/06/28 22:05:21
Changed to "const std::vector<uint8_t>& key" and n
Evan Stade
2014/06/30 18:49:38
in case you were wondering, s/netter/nicer
please use gerrit instead
2014/07/01 04:53:50
Thanks :-) (I too typo tometimes)
|
@@ -62,7 +53,6 @@ class Trie { |
DISALLOW_COPY_AND_ASSIGN(Trie); |
}; |
-} // namespace addressinput |
-} // namespace i18n |
+} // namespace autofill |
-#endif // I18N_ADDRESSINPUT_UTIL_TRIE_H_ |
+#endif // THIRD_PARTY_LIBADDRESSINPUT_CHROMIUM_TRIE_H_ |