OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_SYNC_SYNCABLE_SYNCABLE_ID_H_ | 5 #ifndef CHROME_BROWSER_SYNC_SYNCABLE_SYNCABLE_ID_H_ |
6 #define CHROME_BROWSER_SYNC_SYNCABLE_SYNCABLE_ID_H_ | 6 #define CHROME_BROWSER_SYNC_SYNCABLE_SYNCABLE_ID_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <iosfwd> | 9 #include <iosfwd> |
10 #include <limits> | 10 #include <limits> |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 } | 80 } |
81 inline bool operator != (const Id& that) const { | 81 inline bool operator != (const Id& that) const { |
82 return s_ != that.s_; | 82 return s_ != that.s_; |
83 } | 83 } |
84 inline bool operator < (const Id& that) const { | 84 inline bool operator < (const Id& that) const { |
85 return s_ < that.s_; | 85 return s_ < that.s_; |
86 } | 86 } |
87 inline bool operator > (const Id& that) const { | 87 inline bool operator > (const Id& that) const { |
88 return s_ > that.s_; | 88 return s_ > that.s_; |
89 } | 89 } |
| 90 |
| 91 const std::string& value() const { |
| 92 return s_; |
| 93 } |
| 94 |
90 // Return the next highest ID in the lexicographic ordering. This is | 95 // Return the next highest ID in the lexicographic ordering. This is |
91 // useful for computing upper bounds on std::sets that are ordered | 96 // useful for computing upper bounds on std::sets that are ordered |
92 // by operator<. | 97 // by operator<. |
93 Id GetLexicographicSuccessor() const; | 98 Id GetLexicographicSuccessor() const; |
94 | 99 |
95 // Note: |lowercase_query| should be passed in as lower case. | 100 // Note: |lowercase_query| should be passed in as lower case. |
96 bool ContainsStringCaseInsensitive(const std::string& lowercase_query) const; | 101 bool ContainsStringCaseInsensitive(const std::string& lowercase_query) const; |
97 | 102 |
98 // Dumps the ID as a value and returns it. Transfers ownership of | 103 // Dumps the ID as a value and returns it. Transfers ownership of |
99 // the StringValue to the caller. | 104 // the StringValue to the caller. |
(...skipping 21 matching lines...) Expand all Loading... |
121 friend class SyncableIdTest; | 126 friend class SyncableIdTest; |
122 | 127 |
123 std::string s_; | 128 std::string s_; |
124 }; | 129 }; |
125 | 130 |
126 Id GetNullId(); | 131 Id GetNullId(); |
127 | 132 |
128 } // namespace syncable | 133 } // namespace syncable |
129 | 134 |
130 #endif // CHROME_BROWSER_SYNC_SYNCABLE_SYNCABLE_ID_H_ | 135 #endif // CHROME_BROWSER_SYNC_SYNCABLE_SYNCABLE_ID_H_ |
OLD | NEW |