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

Side by Side Diff: generated_files_will_not_submit/choices.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 | « generated_files_will_not_submit/array.cc ('k') | generated_files_will_not_submit/choices.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/choices.json
7 // DO NOT EDIT.
8
9 #ifndef TOOLS_JSON_SCHEMA_COMPILER_TEST_CHOICES_H__
10 #define TOOLS_JSON_SCHEMA_COMPILER_TEST_CHOICES_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 choices {
24
25 //
26 // Types
27 //
28
29 //
30 // Functions
31 //
32
33 namespace TakesIntegersOptional {
34 struct Params {
35 scoped_ptr<std::vector<int> > nums_array;
36
37 scoped_ptr<int> nums_integer;
38
39 enum NumsType {
40 NUMS_NONE,
41 NUMS_ARRAY,
42 NUMS_INTEGER,
43 };
44
45 NumsType nums_type;
46 ~Params();
47
48 static scoped_ptr<Params> Create(const ListValue& args);
49
50 private:
51 Params();
52
53 DISALLOW_COPY_AND_ASSIGN(Params);
54 };
55
56 namespace Result {
57 Value* Create();
58 };
59
60 };
61
62 namespace ReturnChoices {
63
64 namespace Result {
65 Value* Create(const std::vector<int>& result_array);
66 Value* Create(const int result_integer);
67 };
68
69 };
70
71 namespace TakesIntegers {
72 struct Params {
73 scoped_ptr<std::vector<int> > nums_array;
74
75 scoped_ptr<int> nums_integer;
76
77 enum NumsType {
78 NUMS_NONE,
79 NUMS_ARRAY,
80 NUMS_INTEGER,
81 };
82
83 NumsType nums_type;
84 ~Params();
85
86 static scoped_ptr<Params> Create(const ListValue& args);
87
88 private:
89 Params();
90
91 DISALLOW_COPY_AND_ASSIGN(Params);
92 };
93
94 namespace Result {
95 Value* Create();
96 };
97
98 };
99
100 namespace ObjectWithChoices {
101 struct Params {
102 struct StringInfo {
103 ~StringInfo();
104 StringInfo();
105
106 scoped_ptr<std::vector<int> > integers_array;
107
108 scoped_ptr<int> integers_integer;
109
110 scoped_ptr<std::vector<std::string> > strings_array;
111
112 scoped_ptr<std::string> strings_string;
113
114 enum IntegersType {
115 INTEGERS_NONE,
116 INTEGERS_ARRAY,
117 INTEGERS_INTEGER,
118 };
119
120 IntegersType integers_type;
121 enum StringsType {
122 STRINGS_NONE,
123 STRINGS_ARRAY,
124 STRINGS_STRING,
125 };
126
127 StringsType strings_type;
128 // Populates a StringInfo object from a Value. Returns whether |out| was
129 // successfully populated.
130 static bool Populate(const Value& value, StringInfo* out);
131
132
133 private:
134 DISALLOW_COPY_AND_ASSIGN(StringInfo);
135 };
136
137 StringInfo string_info;
138
139 ~Params();
140
141 static scoped_ptr<Params> Create(const ListValue& args);
142
143 private:
144 Params();
145
146 DISALLOW_COPY_AND_ASSIGN(Params);
147 };
148
149 namespace Result {
150 Value* Create();
151 };
152
153 };
154
155
156 } // choices
157 } // api
158 } // test
159
160 #endif // TOOLS_JSON_SCHEMA_COMPILER_TEST_CHOICES_H__
OLDNEW
« no previous file with comments | « generated_files_will_not_submit/array.cc ('k') | generated_files_will_not_submit/choices.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698