OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 #ifndef CHROMEOS_NETWORK_ONC_ONC_TRANSLATION_TABLES_H_ | 5 #ifndef CHROMEOS_NETWORK_ONC_ONC_TRANSLATION_TABLES_H_ |
6 #define CHROMEOS_NETWORK_ONC_ONC_TRANSLATION_TABLES_H_ | 6 #define CHROMEOS_NETWORK_ONC_ONC_TRANSLATION_TABLES_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 25 matching lines...) Expand all Loading... |
36 CHROMEOS_EXPORT extern const StringTranslationEntry kRoamingStateTable[]; | 36 CHROMEOS_EXPORT extern const StringTranslationEntry kRoamingStateTable[]; |
37 | 37 |
38 // A separate translation table for cellular properties that are stored in a | 38 // A separate translation table for cellular properties that are stored in a |
39 // Shill Device instead of a Service. The |shill_property_name| entries | 39 // Shill Device instead of a Service. The |shill_property_name| entries |
40 // reference Device properties, not Service properties. | 40 // reference Device properties, not Service properties. |
41 extern const FieldTranslationEntry kCellularDeviceTable[]; | 41 extern const FieldTranslationEntry kCellularDeviceTable[]; |
42 | 42 |
43 const FieldTranslationEntry* GetFieldTranslationTable( | 43 const FieldTranslationEntry* GetFieldTranslationTable( |
44 const OncValueSignature& onc_signature); | 44 const OncValueSignature& onc_signature); |
45 | 45 |
| 46 // Returns the path at which the translation of an ONC object will be stored in |
| 47 // a Shill dictionary if its signature is |onc_signature|. |
| 48 // The default is that values are stored directly in the top level of the Shill |
| 49 // dictionary. |
46 std::vector<std::string> GetPathToNestedShillDictionary( | 50 std::vector<std::string> GetPathToNestedShillDictionary( |
47 const OncValueSignature& onc_signature); | 51 const OncValueSignature& onc_signature); |
48 | 52 |
49 bool GetShillPropertyName(const std::string& onc_field_name, | 53 bool GetShillPropertyName(const std::string& onc_field_name, |
50 const FieldTranslationEntry table[], | 54 const FieldTranslationEntry table[], |
51 std::string* shill_property_name); | 55 std::string* shill_property_name); |
52 | 56 |
53 // Translate individual strings to Shill using the above tables. | 57 // Translate individual strings to Shill using the above tables. |
54 CHROMEOS_EXPORT bool TranslateStringToShill( | 58 CHROMEOS_EXPORT bool TranslateStringToShill( |
55 const StringTranslationEntry table[], | 59 const StringTranslationEntry table[], |
56 const std::string& onc_value, | 60 const std::string& onc_value, |
57 std::string* shill_value); | 61 std::string* shill_value); |
58 | 62 |
59 // Translate individual strings to ONC using the above tables. | 63 // Translate individual strings to ONC using the above tables. |
60 CHROMEOS_EXPORT bool TranslateStringToONC(const StringTranslationEntry table[], | 64 CHROMEOS_EXPORT bool TranslateStringToONC(const StringTranslationEntry table[], |
61 const std::string& shill_value, | 65 const std::string& shill_value, |
62 std::string* onc_value); | 66 std::string* onc_value); |
63 | 67 |
64 } // namespace onc | 68 } // namespace onc |
65 } // namespace chromeos | 69 } // namespace chromeos |
66 | 70 |
67 #endif // CHROMEOS_NETWORK_ONC_ONC_TRANSLATION_TABLES_H_ | 71 #endif // CHROMEOS_NETWORK_ONC_ONC_TRANSLATION_TABLES_H_ |
OLD | NEW |