1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef SYNCABLE_PROTOCOL_PROTO_UTIL_H_
6 #define SYNCABLE_PROTOCOL_PROTO_UTIL_H_
10 #include "sync/syncable/syncable_id.h"
18 // Converts from a specially formatted string field to a syncable::Id. Used
19 // when interpreting the fields of protocol buffers received from the server.
20 syncable::Id
SyncableIdFromProto(const std::string
& proto_string
);
22 // Converts from a syncable::Id to a formatted std::string. This is useful for
23 // populating the fields of a protobuf which will be sent to the server.
24 std::string
SyncableIdToProto(const syncable::Id
& syncable_id
);
26 // Helper function to determine if this SyncEntity's properties indicate that it
28 bool IsFolder(const sync_pb::SyncEntity
& entity
);
30 // Helper function to determine if this SyncEntity's properties indicate that it
32 bool IsRoot(const sync_pb::SyncEntity
& entity
);
36 #endif // SYNCABLE_PROTOCOL_PROTO_UTIL_H_