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); | |
55 ENUM_CASE(SERVER_POSITION_IN_PARENT); | 51 ENUM_CASE(SERVER_POSITION_IN_PARENT); |
56 ENUM_CASE(LOCAL_EXTERNAL_ID); | 52 ENUM_CASE(LOCAL_EXTERNAL_ID); |
57 case INT64_FIELDS_END: break; | 53 case INT64_FIELDS_END: break; |
58 } | 54 } |
59 NOTREACHED(); | 55 NOTREACHED(); |
60 return ""; | 56 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 ""; |
61 } | 71 } |
62 | 72 |
63 const char* GetIdFieldString(IdField id_field) { | 73 const char* GetIdFieldString(IdField id_field) { |
64 ASSERT_ENUM_BOUNDS(ID, NEXT_ID, | 74 ASSERT_ENUM_BOUNDS(ID, NEXT_ID, |
65 ID_FIELDS_BEGIN, ID_FIELDS_END - 1); | 75 ID_FIELDS_BEGIN, ID_FIELDS_END - 1); |
66 switch (id_field) { | 76 switch (id_field) { |
67 ENUM_CASE(ID); | 77 ENUM_CASE(ID); |
68 ENUM_CASE(PARENT_ID); | 78 ENUM_CASE(PARENT_ID); |
69 ENUM_CASE(SERVER_PARENT_ID); | 79 ENUM_CASE(SERVER_PARENT_ID); |
70 ENUM_CASE(PREV_ID); | 80 ENUM_CASE(PREV_ID); |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 case BIT_TEMPS_END: break; | 154 case BIT_TEMPS_END: break; |
145 } | 155 } |
146 NOTREACHED(); | 156 NOTREACHED(); |
147 return ""; | 157 return ""; |
148 } | 158 } |
149 | 159 |
150 #undef ENUM_CASE | 160 #undef ENUM_CASE |
151 #undef ASSERT_ENUM_BOUNDS | 161 #undef ASSERT_ENUM_BOUNDS |
152 | 162 |
153 } // namespace syncable | 163 } // namespace syncable |
OLD | NEW |