summaryrefslogtreecommitdiffstats
path: root/tools/json_schema_compiler/util.h
diff options
context:
space:
mode:
Diffstat (limited to 'tools/json_schema_compiler/util.h')
-rw-r--r--tools/json_schema_compiler/util.h30
1 files changed, 16 insertions, 14 deletions
diff --git a/tools/json_schema_compiler/util.h b/tools/json_schema_compiler/util.h
index 425487d..7957830 100644
--- a/tools/json_schema_compiler/util.h
+++ b/tools/json_schema_compiler/util.h
@@ -18,21 +18,23 @@ namespace util {
// Creates a new item at |out| from |from|[|index|]. These are used by template
// specializations of |Get(Optional)ArrayFromList|.
-bool GetItemFromList(const ListValue& from, int index, int* out);
-bool GetItemFromList(const ListValue& from, int index, bool* out);
-bool GetItemFromList(const ListValue& from, int index, double* out);
-bool GetItemFromList(const ListValue& from, int index, std::string* out);
-bool GetItemFromList(const ListValue& from,
+bool GetItemFromList(const base::ListValue& from, int index, int* out);
+bool GetItemFromList(const base::ListValue& from, int index, bool* out);
+bool GetItemFromList(const base::ListValue& from, int index, double* out);
+bool GetItemFromList(const base::ListValue& from, int index, std::string* out);
+bool GetItemFromList(const base::ListValue& from,
int index,
linked_ptr<base::Value>* out);
-bool GetItemFromList(const ListValue& from,
+bool GetItemFromList(const base::ListValue& from,
int index,
linked_ptr<base::DictionaryValue>* out);
// This template is used for types generated by tools/json_schema_compiler.
template<class T>
-bool GetItemFromList(const ListValue& from, int index, linked_ptr<T>* out) {
- const DictionaryValue* dict;
+bool GetItemFromList(const base::ListValue& from,
+ int index,
+ linked_ptr<T>* out) {
+ const base::DictionaryValue* dict;
if (!from.GetDictionary(index, &dict))
return false;
scoped_ptr<T> obj(new T());
@@ -45,7 +47,7 @@ bool GetItemFromList(const ListValue& from, int index, linked_ptr<T>* out) {
// This is used for getting an enum out of a ListValue, which will happen if an
// array of enums is a parameter to a function.
template<class T>
-bool GetItemFromList(const ListValue& from, int index, T* out) {
+bool GetItemFromList(const base::ListValue& from, int index, T* out) {
int value;
if (!from.GetInteger(index, &value))
return false;
@@ -139,7 +141,7 @@ void AddItemToList(const linked_ptr<base::DictionaryValue>& from,
// This template is used for types generated by tools/json_schema_compiler.
template<class T>
-void AddItemToList(const linked_ptr<T>& from, ListValue* out) {
+void AddItemToList(const linked_ptr<T>& from, base::ListValue* out) {
out->Append(from->ToValue().release());
}
@@ -168,18 +170,18 @@ void PopulateListFromOptionalArray(
}
template <class T>
-scoped_ptr<Value> CreateValueFromArray(const std::vector<T>& from) {
+scoped_ptr<base::Value> CreateValueFromArray(const std::vector<T>& from) {
base::ListValue* list = new base::ListValue();
PopulateListFromArray(from, list);
- return scoped_ptr<Value>(list);
+ return scoped_ptr<base::Value>(list);
}
template <class T>
-scoped_ptr<Value> CreateValueFromOptionalArray(
+scoped_ptr<base::Value> CreateValueFromOptionalArray(
const scoped_ptr<std::vector<T> >& from) {
if (from.get())
return CreateValueFromArray(*from);
- return scoped_ptr<Value>();
+ return scoped_ptr<base::Value>();
}
} // namespace util