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.h

Issue 9491002: json_schema_compiler: any, additionalProperties, functions on types (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: add any in arrays to util.h Created 8 years, 10 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
« no previous file with comments | « tools/json_schema_compiler/test/json_schema_compiler_tests.gyp ('k') | tools/json_schema_compiler/util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/json_schema_compiler/util.h
diff --git a/tools/json_schema_compiler/util.h b/tools/json_schema_compiler/util.h
index f71c93cb9f8a138f9ad274771bd7ab8f0cbd6648..c3e3b1def72e4abfb8782ee7a5a0a0605727cd89 100644
--- a/tools/json_schema_compiler/util.h
+++ b/tools/json_schema_compiler/util.h
@@ -14,6 +14,11 @@
#include "base/values.h"
namespace json_schema_compiler {
+
+namespace any {
+class Any;
+}
+
namespace util {
// Creates a new item at |out| from |from|[|index|]. These are used by template
@@ -24,6 +29,8 @@ bool GetItemFromList(const ListValue& from, int index, double* out);
bool GetItemFromList(const ListValue& from, int index, std::string* out);
bool GetItemFromList(const ListValue& from, int index,
linked_ptr<base::DictionaryValue>* out);
+bool GetItemFromList(const ListValue& from, int index,
+ linked_ptr<any::Any>* out);
// This template is used for types generated by tools/json_schema_compiler.
template<class T>
@@ -119,6 +126,8 @@ void AddItemToList(const double from, base::ListValue* out);
void AddItemToList(const std::string& from, base::ListValue* out);
void AddItemToList(const linked_ptr<base::DictionaryValue>& from,
base::ListValue* out);
+void AddItemToList(const linked_ptr<any::Any>& from,
+ base::ListValue* out);
// This template is used for types generated by tools/json_schema_compiler.
template<class T>
@@ -166,7 +175,7 @@ scoped_ptr<Value> CreateValueFromOptionalArray(
return scoped_ptr<Value>();
}
-} // namespace api_util
-} // namespace extensions
+} // namespace util
+} // namespace json_schema_compiler
#endif // TOOLS_JSON_SCHEMA_COMPILER_UTIL_H__
« no previous file with comments | « tools/json_schema_compiler/test/json_schema_compiler_tests.gyp ('k') | tools/json_schema_compiler/util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698