OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Keep this file in sync with syncable.h. | 5 // Keep this file in sync with syncable.h. |
6 | 6 |
7 #include "chrome/browser/sync/syncable/syncable_enum_conversions.h" | 7 #include "chrome/browser/sync/syncable/syncable_enum_conversions.h" |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 30 matching lines...) Expand all Loading... |
41 } | 41 } |
42 NOTREACHED(); | 42 NOTREACHED(); |
43 return ""; | 43 return ""; |
44 } | 44 } |
45 | 45 |
46 const char* GetInt64FieldString(Int64Field int64_field) { | 46 const char* GetInt64FieldString(Int64Field int64_field) { |
47 ASSERT_ENUM_BOUNDS(SERVER_VERSION, LOCAL_EXTERNAL_ID, | 47 ASSERT_ENUM_BOUNDS(SERVER_VERSION, LOCAL_EXTERNAL_ID, |
48 BASE_VERSION + 1, INT64_FIELDS_END - 1); | 48 BASE_VERSION + 1, INT64_FIELDS_END - 1); |
49 switch (int64_field) { | 49 switch (int64_field) { |
50 ENUM_CASE(SERVER_VERSION); | 50 ENUM_CASE(SERVER_VERSION); |
| 51 ENUM_CASE(MTIME); |
| 52 ENUM_CASE(SERVER_MTIME); |
| 53 ENUM_CASE(CTIME); |
| 54 ENUM_CASE(SERVER_CTIME); |
51 ENUM_CASE(SERVER_POSITION_IN_PARENT); | 55 ENUM_CASE(SERVER_POSITION_IN_PARENT); |
52 ENUM_CASE(LOCAL_EXTERNAL_ID); | 56 ENUM_CASE(LOCAL_EXTERNAL_ID); |
53 case INT64_FIELDS_END: break; | 57 case INT64_FIELDS_END: break; |
54 } | 58 } |
55 NOTREACHED(); | 59 NOTREACHED(); |
56 return ""; | 60 return ""; |
57 } | |
58 | |
59 const char* GetTimeFieldString(TimeField time_field) { | |
60 ASSERT_ENUM_BOUNDS(SERVER_VERSION, LOCAL_EXTERNAL_ID, | |
61 BASE_VERSION + 1, INT64_FIELDS_END - 1); | |
62 switch (time_field) { | |
63 ENUM_CASE(MTIME); | |
64 ENUM_CASE(SERVER_MTIME); | |
65 ENUM_CASE(CTIME); | |
66 ENUM_CASE(SERVER_CTIME); | |
67 case TIME_FIELDS_END: break; | |
68 } | |
69 NOTREACHED(); | |
70 return ""; | |
71 } | 61 } |
72 | 62 |
73 const char* GetIdFieldString(IdField id_field) { | 63 const char* GetIdFieldString(IdField id_field) { |
74 ASSERT_ENUM_BOUNDS(ID, NEXT_ID, | 64 ASSERT_ENUM_BOUNDS(ID, NEXT_ID, |
75 ID_FIELDS_BEGIN, ID_FIELDS_END - 1); | 65 ID_FIELDS_BEGIN, ID_FIELDS_END - 1); |
76 switch (id_field) { | 66 switch (id_field) { |
77 ENUM_CASE(ID); | 67 ENUM_CASE(ID); |
78 ENUM_CASE(PARENT_ID); | 68 ENUM_CASE(PARENT_ID); |
79 ENUM_CASE(SERVER_PARENT_ID); | 69 ENUM_CASE(SERVER_PARENT_ID); |
80 ENUM_CASE(PREV_ID); | 70 ENUM_CASE(PREV_ID); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 case BIT_TEMPS_END: break; | 144 case BIT_TEMPS_END: break; |
155 } | 145 } |
156 NOTREACHED(); | 146 NOTREACHED(); |
157 return ""; | 147 return ""; |
158 } | 148 } |
159 | 149 |
160 #undef ENUM_CASE | 150 #undef ENUM_CASE |
161 #undef ASSERT_ENUM_BOUNDS | 151 #undef ASSERT_ENUM_BOUNDS |
162 | 152 |
163 } // namespace syncable | 153 } // namespace syncable |
OLD | NEW |