| 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_VALIDATOR_H_ | 5 #ifndef CHROMEOS_NETWORK_ONC_ONC_VALIDATOR_H_ |
| 6 #define CHROMEOS_NETWORK_ONC_ONC_VALIDATOR_H_ | 6 #define CHROMEOS_NETWORK_ONC_ONC_VALIDATOR_H_ |
| 7 | 7 |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 const std::vector<const char*>& valid_values); | 175 const std::vector<const char*>& valid_values); |
| 176 | 176 |
| 177 bool FieldExistsAndIsNotInRange(const base::DictionaryValue& object, | 177 bool FieldExistsAndIsNotInRange(const base::DictionaryValue& object, |
| 178 const std::string &field_name, | 178 const std::string &field_name, |
| 179 int lower_bound, | 179 int lower_bound, |
| 180 int upper_bound); | 180 int upper_bound); |
| 181 | 181 |
| 182 bool FieldExistsAndIsEmpty(const base::DictionaryValue& object, | 182 bool FieldExistsAndIsEmpty(const base::DictionaryValue& object, |
| 183 const std::string& field_name); | 183 const std::string& field_name); |
| 184 | 184 |
| 185 bool IsSSIDOrHexSSIDValid(const base::DictionaryValue& object); |
| 186 |
| 185 // Returns true if |key| is a key of |dict|. Otherwise, returns false and, | 187 // Returns true if |key| is a key of |dict|. Otherwise, returns false and, |
| 186 // depending on |error_on_missing_field_|, logs a message and sets | 188 // depending on |error_on_missing_field_|, logs a message and sets |
| 187 // |error_or_warning_found_|. | 189 // |error_or_warning_found_|. |
| 188 bool RequireField(const base::DictionaryValue& dict, const std::string& key); | 190 bool RequireField(const base::DictionaryValue& dict, const std::string& key); |
| 189 | 191 |
| 190 // Returns true if the GUID is unique or if the GUID is not a string | 192 // Returns true if the GUID is unique or if the GUID is not a string |
| 191 // and false otherwise. The function also adds the GUID to a set in | 193 // and false otherwise. The function also adds the GUID to a set in |
| 192 // order to identify duplicates. | 194 // order to identify duplicates. |
| 193 bool CheckGuidIsUniqueAndAddToSet(const base::DictionaryValue& dict, | 195 bool CheckGuidIsUniqueAndAddToSet(const base::DictionaryValue& dict, |
| 194 const std::string& kGUID, | 196 const std::string& kGUID, |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 // function ValidateAndRepairObject. | 229 // function ValidateAndRepairObject. |
| 228 bool error_or_warning_found_; | 230 bool error_or_warning_found_; |
| 229 | 231 |
| 230 DISALLOW_COPY_AND_ASSIGN(Validator); | 232 DISALLOW_COPY_AND_ASSIGN(Validator); |
| 231 }; | 233 }; |
| 232 | 234 |
| 233 } // namespace onc | 235 } // namespace onc |
| 234 } // namespace chromeos | 236 } // namespace chromeos |
| 235 | 237 |
| 236 #endif // CHROMEOS_NETWORK_ONC_ONC_VALIDATOR_H_ | 238 #endif // CHROMEOS_NETWORK_ONC_ONC_VALIDATOR_H_ |
| OLD | NEW |