Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Unified Diff: tools/json_schema_compiler/util.cc

Issue 16462004: Add optional schema compiler error messages Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Kalman's requests Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: tools/json_schema_compiler/util.cc
diff --git a/tools/json_schema_compiler/util.cc b/tools/json_schema_compiler/util.cc
index 25f908cf2af0537b6c328af66c450833fde04732..c4d3d64b6fa1290dd8d9be8f7c7cda3043aca056 100644
--- a/tools/json_schema_compiler/util.cc
+++ b/tools/json_schema_compiler/util.cc
@@ -70,5 +70,30 @@ void AddItemToList(const linked_ptr<base::DictionaryValue>& from,
out->Append(static_cast<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 "int";
not at google - send to devlin 2013/06/19 17:02:08 "integer"
+ case Value::TYPE_DOUBLE:
+ return "double";
not at google - send to devlin 2013/06/19 17:02:08 "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";
+ default:
+ ;
not at google - send to devlin 2013/06/19 17:02:08 no default case
+ }
+ NOTREACHED();
+ return "";
+}
+
} // namespace api_util
} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698