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

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..03cb517b9d8c6015db1fda739ef10dd2a400d957 100644
--- a/tools/json_schema_compiler/util.cc
+++ b/tools/json_schema_compiler/util.cc
@@ -70,5 +70,39 @@ void AddItemToList(const linked_ptr<base::DictionaryValue>& from,
out->Append(static_cast<Value*>(from->DeepCopy()));
}
+std::string ValueTypeToString(Value::Type type) {
+ std::string out;
+ switch(type) {
+ case Value::TYPE_NULL:
+ out = "null";
+ break;
+ case Value::TYPE_BOOLEAN:
+ out = "boolean";
+ break;
+ case Value::TYPE_INTEGER:
+ out = "int";
+ break;
+ case Value::TYPE_DOUBLE:
+ out = "double";
+ break;
+ case Value::TYPE_STRING:
+ out = "std::string";
not at google - send to devlin 2013/06/14 21:48:39 just "string"
Aaron Jacobs 2013/06/15 00:47:18 Done.
+ break;
+ case Value::TYPE_BINARY:
+ out = "binary";
+ break;
+ case Value::TYPE_DICTIONARY:
+ out = "dictionary";
+ break;
+ case Value::TYPE_LIST:
+ out = "list";
+ break;
+ default:
+ NOTREACHED();
+ }
+
+ return out;
+}
not at google - send to devlin 2013/06/14 21:48:39 1. this can be a lot shorter if you just have 'ret
Aaron Jacobs 2013/06/15 00:47:18 Done.
+
} // namespace api_util
} // namespace extensions
« tools/json_schema_compiler/h_generator.py ('K') | « tools/json_schema_compiler/util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698