summaryrefslogtreecommitdiffstats
path: root/tools/json_schema_compiler/util.cc
diff options
context:
space:
mode:
Diffstat (limited to 'tools/json_schema_compiler/util.cc')
-rw-r--r--tools/json_schema_compiler/util.cc23
1 files changed, 23 insertions, 0 deletions
diff --git a/tools/json_schema_compiler/util.cc b/tools/json_schema_compiler/util.cc
index a449509..c03d076 100644
--- a/tools/json_schema_compiler/util.cc
+++ b/tools/json_schema_compiler/util.cc
@@ -70,5 +70,28 @@ void AddItemToList(const linked_ptr<base::DictionaryValue>& from,
out->Append(static_cast<base::Value*>(from->DeepCopy()));
}
+std::string ValueTypeToString(Value::Type type) {
+ switch(type) {
+ case Value::TYPE_NULL:
+ return "null";
+ case Value::TYPE_BOOLEAN:
+ return "boolean";
+ case Value::TYPE_INTEGER:
+ return "integer";
+ case Value::TYPE_DOUBLE:
+ return "number";
+ case Value::TYPE_STRING:
+ return "string";
+ case Value::TYPE_BINARY:
+ return "binary";
+ case Value::TYPE_DICTIONARY:
+ return "dictionary";
+ case Value::TYPE_LIST:
+ return "list";
+ }
+ NOTREACHED();
+ return "";
+}
+
} // namespace api_util
} // namespace extensions