blob: b5a313d3c4baeac1e3d0859461d8a5628d0d94ab [file] [log] [blame]
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "components/sync/syncable/syncable_proto_util.h"
#include "components/sync/protocol/sync.pb.h"
namespace syncer {
syncable::Id SyncableIdFromProto(const std::string& proto_string) {
return syncable::Id::CreateFromServerId(proto_string);
std::string SyncableIdToProto(const syncable::Id& syncable_id) {
return syncable_id.GetServerId();
bool IsFolder(const sync_pb::SyncEntity& entity) {
return entity.folder();
bool IsRoot(const sync_pb::SyncEntity& entity) {
return SyncableIdFromProto(entity.id_string()).IsRoot();
} // namespace syncer