Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(67)

Side by Side Diff: sync/api/string_ordinal.h

Issue 2130453004: [Sync] Move //sync to //components/sync. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « sync/api/model_type_store.cc ('k') | sync/api/sync_change.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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 SYNC_API_STRING_ORDINAL_H_
6 #define SYNC_API_STRING_ORDINAL_H_
7
8 #include <stddef.h>
9 #include <stdint.h>
10
11 #include "sync/internal_api/public/base/ordinal.h"
12
13 namespace syncer {
14
15 // A StringOrdinal is an Ordinal with range 'a'-'z' for printability
16 // of its internal byte string representation. (Think of
17 // StringOrdinal as being short for PrintableStringOrdinal.) It
18 // should be used for data types that want to maintain one or more
19 // orderings for nodes.
20 //
21 // Since StringOrdinals contain only printable characters, it is safe
22 // to store as a string in a protobuf.
23
24 struct StringOrdinalTraits {
25 static const uint8_t kZeroDigit = 'a';
26 static const uint8_t kMaxDigit = 'z';
27 static const size_t kMinLength = 1;
28 };
29
30 typedef Ordinal<StringOrdinalTraits> StringOrdinal;
31
32 static_assert(StringOrdinal::kZeroDigit == 'a',
33 "StringOrdinal has incorrect zero digit");
34 static_assert(StringOrdinal::kOneDigit == 'b',
35 "StringOrdinal has incorrect one digit");
36 static_assert(StringOrdinal::kMidDigit == 'n',
37 "StringOrdinal has incorrect mid digit");
38 static_assert(StringOrdinal::kMaxDigit == 'z',
39 "StringOrdinal has incorrect max digit");
40 static_assert(StringOrdinal::kMidDigitValue == 13,
41 "StringOrdinal has incorrect mid digit value");
42 static_assert(StringOrdinal::kMaxDigitValue == 25,
43 "StringOrdinal has incorrect max digit value");
44 static_assert(StringOrdinal::kRadix == 26,
45 "StringOrdinal has incorrect radix");
46
47 } // namespace syncer
48
49 #endif // SYNC_API_STRING_ORDINAL_H_
OLDNEW
« no previous file with comments | « sync/api/model_type_store.cc ('k') | sync/api/sync_change.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698