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

Unified Diff: tools/json_schema_compiler/util.h

Issue 9114036: Code generation for extensions api (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: more rework Created 8 years, 11 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.h
diff --git a/tools/json_schema_compiler/util.h b/tools/json_schema_compiler/util.h
new file mode 100644
index 0000000000000000000000000000000000000000..f9c5c12f865a3c033731d13bcd7e524a8356a0ca
--- /dev/null
+++ b/tools/json_schema_compiler/util.h
@@ -0,0 +1,51 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef TOOLS_JSON_SCHEMA_COMPILER_UTIL_H__
+#define TOOLS_JSON_SCHEMA_COMPILER_UTIL_H__
+#pragma once
+
+#include <string>
+#include <vector>
+
+#include "base/memory/scoped_ptr.h"
+
+namespace base {
+class DictionaryValue;
+}
+
+namespace json_schema_compiler {
+namespace util {
+
+// Pushes string of |from|.|name| and into |out|. Returns false if there is no
not at google - send to devlin 2012/01/17 05:42:32 "Adds string of |from|.|name| to |out|. Returns fa
+// list at the specified key or if the list has anything other than strings.
+bool GetStrings(
+ const base::DictionaryValue& from,
+ const std::string& name,
+ std::vector<std::string>* out);
+
+// Pushes string of |from|.|name| and into |out|. Returns true on success or
not at google - send to devlin 2012/01/17 05:42:32 ditto
+// if there is nothing at the specified key. Returns false if anything other
+// than a list of strings is at the specified key.
+bool GetOptionalStrings(
+ const base::DictionaryValue& from,
+ const std::string& name,
+ scoped_ptr<std::vector<std::string> >* out);
+
+// Puts the vector of strings in |from| into a new ListValue at |out|.|name|.
not at google - send to devlin 2012/01/17 05:42:32 "Puts each string in |from|" ...
+void SetStrings(
+ const std::vector<std::string>& from,
+ const std::string& name,
+ base::DictionaryValue* out);
+
+// If from is non-NULL, puts each string in |from| into the |out|.|name|.
not at google - send to devlin 2012/01/17 05:42:32 "If |from| is non-NULL, puts each string $commentF
+void SetOptionalStrings(
+ const scoped_ptr<std::vector<std::string> >& from,
+ const std::string& name,
+ base::DictionaryValue* out);
+
+} // namespace api_util
+} // namespace extensions
+
+#endif // TOOLS_JSON_SCHEMA_COMPILER_UTIL_H__

Powered by Google App Engine
This is Rietveld 408576698