summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/json_schema_compiler/util.h37
-rw-r--r--tools/json_schema_compiler/util_cc_helper.py24
2 files changed, 0 insertions, 61 deletions
diff --git a/tools/json_schema_compiler/util.h b/tools/json_schema_compiler/util.h
index a7e0a6e..ae0aca2 100644
--- a/tools/json_schema_compiler/util.h
+++ b/tools/json_schema_compiler/util.h
@@ -60,20 +60,6 @@ bool PopulateArrayFromList(
return true;
}
-// Populates |out| with |from|.|name|. Returns false if there is no list at
-// the specified key or if the list has anything other than |T|.
-template <class T>
-bool PopulateArrayFromDictionary(
- const base::DictionaryValue& from,
- const std::string& name,
- std::vector<T>* out) {
- const base::ListValue* list = NULL;
- if (!from.GetListWithoutPathExpansion(name, &list))
- return false;
-
- return PopulateArrayFromList(*list, out);
-}
-
// Creates a new vector containing |list| at |out|. Returns
// true on success or if there is nothing at the specified key. Returns false
// if anything other than a list of |T| is at the specified key.
@@ -94,29 +80,6 @@ bool PopulateOptionalArrayFromList(
return true;
}
-// Creates a new vector containing |from|.|name| at |out|. Returns
-// true on success or if there is nothing at the specified key. Returns false
-// if anything other than a list of |T| is at the specified key.
-template <class T>
-bool PopulateOptionalArrayFromDictionary(
- const base::DictionaryValue& from,
- const std::string& name,
- scoped_ptr<std::vector<T> >* out) {
- const base::ListValue* list = NULL;
- {
- const base::Value* maybe_list = NULL;
- // Since |name| is optional, its absence is acceptable. However, anything
- // other than a ListValue is not.
- if (!from.GetWithoutPathExpansion(name, &maybe_list))
- return true;
- if (!maybe_list->IsType(base::Value::TYPE_LIST))
- return false;
- list = static_cast<const base::ListValue*>(maybe_list);
- }
-
- return PopulateOptionalArrayFromList(*list, out);
-}
-
// Appends a Value newly created from |from| to |out|. These used by template
// specializations of |Set(Optional)ArrayToList|.
void AddItemToList(const int from, base::ListValue* out);
diff --git a/tools/json_schema_compiler/util_cc_helper.py b/tools/json_schema_compiler/util_cc_helper.py
index 0e41abf..ee5d6f5 100644
--- a/tools/json_schema_compiler/util_cc_helper.py
+++ b/tools/json_schema_compiler/util_cc_helper.py
@@ -12,30 +12,6 @@ class UtilCCHelper(object):
def __init__(self, type_manager):
self._type_manager = type_manager
- def PopulateArrayFromDictionary(self, array_prop, src, name, dst):
- """Generates code to get an array from a src.name into dst.
-
- src: DictionaryValue*
- dst: std::vector or scoped_ptr<std::vector>
- """
- prop = array_prop.item_type
- sub = {
- 'namespace': _API_UTIL_NAMESPACE,
- 'name': name,
- 'src': src,
- 'dst': dst,
- }
-
- sub['type'] = self._type_manager.GetCppType(prop),
- if array_prop.optional:
- val = ('%(namespace)s::PopulateOptionalArrayFromDictionary'
- '(*%(src)s, "%(name)s", &%(dst)s)')
- else:
- val = ('%(namespace)s::PopulateArrayFromDictionary'
- '(*%(src)s, "%(name)s", &%(dst)s)')
-
- return val % sub
-
def PopulateArrayFromList(self, src, dst, optional):
"""Generates code to get an array from src into dst.