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

Side by Side 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: windows path fix 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 unified diff | Download patch
« no previous file with comments | « tools/json_schema_compiler/test/windows.json ('k') | tools/json_schema_compiler/util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef TOOLS_JSON_SCHEMA_COMPILER_UTIL_H__
6 #define TOOLS_JSON_SCHEMA_COMPILER_UTIL_H__
7 #pragma once
8
9 #include <string>
10 #include <vector>
11
12 #include "base/memory/scoped_ptr.h"
13
14 namespace base {
15 class DictionaryValue;
16 }
17
18 namespace json_schema_compiler {
19 namespace util {
20
21 // Creates a new vector containing the strings |from|.|name| at |out|. Returns
22 // false if there is no list at the specified key or if the list has anything
23 // other than strings.
24 bool GetStrings(
25 const base::DictionaryValue& from,
26 const std::string& name,
27 std::vector<std::string>* out);
28
29 // Creates a new vector containing the strings |from|.|name| at |out|. Returns
30 // true on success or if there is nothing at the specified key. Returns false
31 // if anything other than a list of strings is at the specified key.
32 bool GetOptionalStrings(
33 const base::DictionaryValue& from,
34 const std::string& name,
35 scoped_ptr<std::vector<std::string> >* out);
36
37 // Puts the each string in |from| into a new ListValue at |out|.|name|.
38 void SetStrings(
39 const std::vector<std::string>& from,
40 const std::string& name,
41 base::DictionaryValue* out);
42
43 // If from is non-NULL, puts each string in |from| into a new ListValue at
44 // |out|.|name|.
45 void SetOptionalStrings(
46 const scoped_ptr<std::vector<std::string> >& from,
47 const std::string& name,
48 base::DictionaryValue* out);
49
50 } // namespace api_util
51 } // namespace extensions
52
53 #endif // TOOLS_JSON_SCHEMA_COMPILER_UTIL_H__
OLDNEW
« no previous file with comments | « tools/json_schema_compiler/test/windows.json ('k') | tools/json_schema_compiler/util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698