OLD | NEW |
---|---|
(Empty) | |
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. | |
4 | |
5 #ifndef SYNCABLE_PROTOCOL_PROTO_UTIL_H_ | |
6 #define SYNCABLE_PROTOCOL_PROTO_UTIL_H_ | |
7 | |
8 #include "sync/syncable/syncable_id.h" | |
9 | |
10 namespace sync_pb { | |
11 class SyncEntity; | |
12 } | |
13 | |
14 namespace syncer { | |
15 | |
16 // Converts from a specially formatted string field to a syncable::Id. Used | |
17 // when interpreting the fields of protocol buffers received from the server. | |
18 syncable::Id SyncableIdFromProto(const std::string& proto_string); | |
akalin
2012/07/11 23:10:40
#include <string>
rlarocque
2012/07/11 23:45:36
Done.
| |
19 | |
20 // Converts from a syncable::Id to a formatted std::string. This is useful for | |
21 // populating the fields of a protobuf which will be sent to the server. | |
22 std::string SyncableIdToProto(const syncable::Id& syncable_id); | |
23 | |
24 // Helper function to determine if this SyncEntity's properties indicate that it | |
25 // is a folder. | |
26 bool IsFolder(const sync_pb::SyncEntity& entity); | |
27 | |
28 // Helper function to determine if this SyncEntity's properties indicate that it | |
29 // is the root node. | |
30 bool IsRoot(const sync_pb::SyncEntity& entity); | |
31 | |
32 } // namespace syncer | |
33 | |
34 #endif // SYNCABLE_PROTOCOL_PROTO_UTIL_H_ | |
OLD | NEW |