Index: tools/json_schema_compiler/util.h |
diff --git a/tools/json_schema_compiler/util.h b/tools/json_schema_compiler/util.h |
index 5cc4008867f7eaea9e8f875676652c7e67d64111..ec1af110537a56d8b1887b899b5312fdfd8a108b 100644 |
--- a/tools/json_schema_compiler/util.h |
+++ b/tools/json_schema_compiler/util.h |
@@ -191,6 +191,25 @@ scoped_ptr<base::Value> CreateValueFromOptionalEnumArray( |
return scoped_ptr<base::Value>(); |
} |
+template <class T> |
+scoped_ptr<base::Value> CreateValueFromEnumArrayWithoutNamespace( |
+ const std::vector<T>& from) { |
+ base::ListValue* list = new base::ListValue(); |
+ for (typename std::vector<T>::const_iterator it = from.begin(); |
+ it != from.end(); ++it) { |
+ list->AppendString(ToString(*it)); |
+ } |
+ return scoped_ptr<base::Value>(list); |
+} |
+ |
+template <class T> |
+scoped_ptr<base::Value> CreateValueFromOptionalEnumArrayWithoutNamespace( |
+ const scoped_ptr<std::vector<T> >& from) { |
+ if (from.get()) |
+ return CreateValueFromEnumArrayWithoutNamespace(*from); |
+ return scoped_ptr<base::Value>(); |
+} |
+ |
std::string ValueTypeToString(base::Value::Type type); |
} // namespace util |