| 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 #include "chrome/browser/sync/syncable/syncable_id.h" | 5 #include "chrome/browser/sync/syncable/syncable_id.h" |
| 6 | 6 |
| 7 #include <iosfwd> | 7 #include <iosfwd> |
| 8 | 8 |
| 9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| 11 | 11 |
| 12 using std::ostream; | 12 using std::ostream; |
| 13 using std::string; | 13 using std::string; |
| 14 | 14 |
| 15 namespace syncable { | 15 namespace syncable { |
| 16 const Id kNullId; // Currently == root. | |
| 17 | 16 |
| 18 ostream& operator<<(ostream& out, const Id& id) { | 17 ostream& operator<<(ostream& out, const Id& id) { |
| 19 out << id.s_; | 18 out << id.s_; |
| 20 return out; | 19 return out; |
| 21 } | 20 } |
| 22 | 21 |
| 23 StringValue* Id::ToValue() const { | 22 StringValue* Id::ToValue() const { |
| 24 return Value::CreateStringValue(s_); | 23 return Value::CreateStringValue(s_); |
| 25 } | 24 } |
| 26 | 25 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 return StringToLowerASCII(s_).find(lowercase_query) != std::string::npos; | 63 return StringToLowerASCII(s_).find(lowercase_query) != std::string::npos; |
| 65 } | 64 } |
| 66 | 65 |
| 67 // static | 66 // static |
| 68 Id Id::GetLeastIdForLexicographicComparison() { | 67 Id Id::GetLeastIdForLexicographicComparison() { |
| 69 Id id; | 68 Id id; |
| 70 id.s_.clear(); | 69 id.s_.clear(); |
| 71 return id; | 70 return id; |
| 72 } | 71 } |
| 73 | 72 |
| 73 Id GetNullId() { |
| 74 return Id(); // Currently == root. |
| 75 } |
| 76 |
| 74 } // namespace syncable | 77 } // namespace syncable |
| OLD | NEW |