| Index: components/sync/syncable/syncable_id.h
|
| diff --git a/sync/syncable/syncable_id.h b/components/sync/syncable/syncable_id.h
|
| similarity index 74%
|
| rename from sync/syncable/syncable_id.h
|
| rename to components/sync/syncable/syncable_id.h
|
| index 7dd09d8155175bb15164c0dffe7f45885467c9a8..569757bc7f8672c2e0a2ad257b8ae5607af8a37c 100644
|
| --- a/sync/syncable/syncable_id.h
|
| +++ b/components/sync/syncable/syncable_id.h
|
| @@ -2,8 +2,8 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#ifndef SYNC_SYNCABLE_SYNCABLE_ID_H_
|
| -#define SYNC_SYNCABLE_SYNCABLE_ID_H_
|
| +#ifndef COMPONENTS_SYNC_SYNCABLE_SYNCABLE_ID_H_
|
| +#define COMPONENTS_SYNC_SYNCABLE_SYNCABLE_ID_H_
|
|
|
| #include <iosfwd>
|
| #include <limits>
|
| @@ -12,7 +12,7 @@
|
| #include <string>
|
|
|
| #include "base/containers/hash_tables.h"
|
| -#include "sync/base/sync_export.h"
|
| +#include "components/sync/base/sync_export.h"
|
|
|
| namespace base {
|
| class StringValue;
|
| @@ -42,44 +42,26 @@ SYNC_EXPORT std::ostream& operator<<(std::ostream& out, const Id& id);
|
| class SYNC_EXPORT Id {
|
| public:
|
| inline Id() {}
|
| - inline Id(const Id& that) {
|
| - Copy(that);
|
| - }
|
| - inline Id& operator = (const Id& that) {
|
| + inline Id(const Id& that) { Copy(that); }
|
| + inline Id& operator=(const Id& that) {
|
| Copy(that);
|
| return *this;
|
| }
|
| - inline void Copy(const Id& that) {
|
| - this->s_ = that.s_;
|
| - }
|
| - inline bool IsRoot() const {
|
| - return "r" == s_;
|
| - }
|
| + inline void Copy(const Id& that) { this->s_ = that.s_; }
|
| + inline bool IsRoot() const { return "r" == s_; }
|
| inline bool ServerKnows() const {
|
| return !IsNull() && (s_[0] == 's' || s_ == "r");
|
| }
|
|
|
| inline bool IsNull() const { return s_.empty(); }
|
| inline void Clear() { s_.clear(); }
|
| - inline int compare(const Id& that) const {
|
| - return s_.compare(that.s_);
|
| - }
|
| - inline bool operator == (const Id& that) const {
|
| - return s_ == that.s_;
|
| - }
|
| - inline bool operator != (const Id& that) const {
|
| - return s_ != that.s_;
|
| - }
|
| - inline bool operator < (const Id& that) const {
|
| - return s_ < that.s_;
|
| - }
|
| - inline bool operator > (const Id& that) const {
|
| - return s_ > that.s_;
|
| - }
|
| + inline int compare(const Id& that) const { return s_.compare(that.s_); }
|
| + inline bool operator==(const Id& that) const { return s_ == that.s_; }
|
| + inline bool operator!=(const Id& that) const { return s_ != that.s_; }
|
| + inline bool operator<(const Id& that) const { return s_ < that.s_; }
|
| + inline bool operator>(const Id& that) const { return s_ > that.s_; }
|
|
|
| - const std::string& value() const {
|
| - return s_;
|
| - }
|
| + const std::string& value() const { return s_; }
|
|
|
| // Return the next highest ID in the lexicographic ordering. This is
|
| // useful for computing upper bounds on std::sets that are ordered
|
| @@ -108,8 +90,7 @@ class SYNC_EXPORT Id {
|
| private:
|
| friend std::unique_ptr<EntryKernel> UnpackEntry(sql::Statement* statement,
|
| int* total_created_entries);
|
| - friend void BindFields(const EntryKernel& entry,
|
| - sql::Statement* statement);
|
| + friend void BindFields(const EntryKernel& entry, sql::Statement* statement);
|
| SYNC_EXPORT friend std::ostream& operator<<(std::ostream& out, const Id& id);
|
| friend class SyncableIdTest;
|
|
|
| @@ -119,4 +100,4 @@ class SYNC_EXPORT Id {
|
| } // namespace syncable
|
| } // namespace syncer
|
|
|
| -#endif // SYNC_SYNCABLE_SYNCABLE_ID_H_
|
| +#endif // COMPONENTS_SYNC_SYNCABLE_SYNCABLE_ID_H_
|
|
|