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

Side by Side Diff: generated_files_will_not_submit/array.h

Issue 9309044: Supporting more APIs with json_schema_compiler (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: rework, add a couple of tests 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 | « chrome/chrome_tests.gypi ('k') | generated_files_will_not_submit/array.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 // GENERATED FROM THE API DEFINITION IN
6 // tools/json_schema_compiler/test/array.json
7 // DO NOT EDIT.
8
9 #ifndef TOOLS_JSON_SCHEMA_COMPILER_TEST_ARRAY_H__
10 #define TOOLS_JSON_SCHEMA_COMPILER_TEST_ARRAY_H__
11 #pragma once
12
13 #include <string>
14 #include <vector>
15
16 #include "base/basictypes.h"
17 #include "base/memory/linked_ptr.h"
18 #include "base/memory/scoped_ptr.h"
19 #include "base/values.h"
20
21 namespace test {
22 namespace api {
23 namespace array {
24
25 //
26 // Types
27 //
28
29 struct Item {
30 ~Item();
31 Item();
32
33 int val;
34
35 // Populates a Item object from a Value. Returns whether |out| was
36 // successfully populated.
37 static bool Populate(const Value& value, Item* out);
38
39 // Returns a new DictionaryValue representing the serialized form of this
40 // Item object. Passes ownership to caller.
41 scoped_ptr<DictionaryValue> ToValue() const;
42
43 private:
44 DISALLOW_COPY_AND_ASSIGN(Item);
45 };
46
47 struct BasicArrayType {
48 ~BasicArrayType();
49 BasicArrayType();
50
51 std::vector<int> integers;
52
53 std::vector<bool> booleans;
54
55 std::vector<double> numbers;
56
57 std::vector<std::string> strings;
58
59 // Populates a BasicArrayType object from a Value. Returns whether |out| was
60 // successfully populated.
61 static bool Populate(const Value& value, BasicArrayType* out);
62
63 // Returns a new DictionaryValue representing the serialized form of this
64 // BasicArrayType object. Passes ownership to caller.
65 scoped_ptr<DictionaryValue> ToValue() const;
66
67 private:
68 DISALLOW_COPY_AND_ASSIGN(BasicArrayType);
69 };
70
71 struct RefArrayType {
72 ~RefArrayType();
73 RefArrayType();
74
75 std::vector<linked_ptr<Item> > refs;
76
77 // Populates a RefArrayType object from a Value. Returns whether |out| was
78 // successfully populated.
79 static bool Populate(const Value& value, RefArrayType* out);
80
81 // Returns a new DictionaryValue representing the serialized form of this
82 // RefArrayType object. Passes ownership to caller.
83 scoped_ptr<DictionaryValue> ToValue() const;
84
85 private:
86 DISALLOW_COPY_AND_ASSIGN(RefArrayType);
87 };
88
89 //
90 // Functions
91 //
92
93 namespace IntegerArray {
94 struct Params {
95 std::vector<int> nums;
96
97 ~Params();
98
99 static scoped_ptr<Params> Create(const ListValue& args);
100
101 private:
102 Params();
103
104 DISALLOW_COPY_AND_ASSIGN(Params);
105 };
106
107 namespace Result {
108 Value* Create();
109 };
110
111 };
112
113
114 } // array
115 } // api
116 } // test
117
118 #endif // TOOLS_JSON_SCHEMA_COMPILER_TEST_ARRAY_H__
OLDNEW
« no previous file with comments | « chrome/chrome_tests.gypi ('k') | generated_files_will_not_submit/array.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698