OLD | NEW |
(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/simple_api.json |
| 7 // DO NOT EDIT. |
| 8 |
| 9 #ifndef TOOLS_JSON_SCHEMA_COMPILER_TEST_SIMPLE_API_H__ |
| 10 #define TOOLS_JSON_SCHEMA_COMPILER_TEST_SIMPLE_API_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 simple_api { |
| 24 |
| 25 // |
| 26 // Types |
| 27 // |
| 28 |
| 29 struct TestType { |
| 30 ~TestType(); |
| 31 TestType(); |
| 32 |
| 33 // Some integer. |
| 34 int integer; |
| 35 |
| 36 // Some boolean. |
| 37 bool boolean; |
| 38 |
| 39 // Some string. |
| 40 std::string string; |
| 41 |
| 42 // Some double. |
| 43 double number; |
| 44 |
| 45 // Populates a TestType object from a Value. Returns whether |out| was |
| 46 // successfully populated. |
| 47 static bool Populate(const Value& value, TestType* out); |
| 48 |
| 49 // Returns a new DictionaryValue representing the serialized form of this |
| 50 // TestType object. Passes ownership to caller. |
| 51 scoped_ptr<DictionaryValue> ToValue() const; |
| 52 |
| 53 private: |
| 54 DISALLOW_COPY_AND_ASSIGN(TestType); |
| 55 }; |
| 56 |
| 57 // |
| 58 // Functions |
| 59 // |
| 60 |
| 61 namespace OptionalString { |
| 62 struct Params { |
| 63 scoped_ptr<std::string> str; |
| 64 |
| 65 ~Params(); |
| 66 |
| 67 static scoped_ptr<Params> Create(const ListValue& args); |
| 68 |
| 69 private: |
| 70 Params(); |
| 71 |
| 72 DISALLOW_COPY_AND_ASSIGN(Params); |
| 73 }; |
| 74 |
| 75 namespace Result { |
| 76 Value* Create(); |
| 77 }; |
| 78 |
| 79 }; |
| 80 |
| 81 namespace GetTestType { |
| 82 |
| 83 namespace Result { |
| 84 // A TestType. |
| 85 Value* Create(const TestType& result); |
| 86 }; |
| 87 |
| 88 }; |
| 89 |
| 90 namespace OptionalCallbackParams { |
| 91 |
| 92 namespace Result { |
| 93 // True if the extension has the specified permissions. |
| 94 Value* Create(const TestType& result); |
| 95 }; |
| 96 |
| 97 }; |
| 98 |
| 99 namespace IncrementInteger { |
| 100 struct Params { |
| 101 int num; |
| 102 |
| 103 ~Params(); |
| 104 |
| 105 static scoped_ptr<Params> Create(const ListValue& args); |
| 106 |
| 107 private: |
| 108 Params(); |
| 109 |
| 110 DISALLOW_COPY_AND_ASSIGN(Params); |
| 111 }; |
| 112 |
| 113 namespace Result { |
| 114 // The incremented value. |
| 115 Value* Create(const int result); |
| 116 }; |
| 117 |
| 118 }; |
| 119 |
| 120 |
| 121 } // simple_api |
| 122 } // api |
| 123 } // test |
| 124 |
| 125 #endif // TOOLS_JSON_SCHEMA_COMPILER_TEST_SIMPLE_API_H__ |
OLD | NEW |