OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // This file provides a builders for DictionaryValue and ListValue. These | 5 // This file provides a builders for DictionaryValue and ListValue. These |
6 // aren't specific to extensions and could move up to base/ if there's interest | 6 // aren't specific to extensions and could move up to base/ if there's interest |
7 // from other sub-projects. | 7 // from other sub-projects. |
8 // | 8 // |
9 // The general pattern is to write: | 9 // The general pattern is to write: |
10 // | 10 // |
(...skipping 12 matching lines...) Expand all Loading... |
23 // just-constructed Builder into another Builder's method directly. Use the | 23 // just-constructed Builder into another Builder's method directly. Use the |
24 // Pass() method. | 24 // Pass() method. |
25 // | 25 // |
26 // The Build() method invalidates its builder, and returns ownership of the | 26 // The Build() method invalidates its builder, and returns ownership of the |
27 // built value. | 27 // built value. |
28 // | 28 // |
29 // These objects are intended to be used as temporaries rather than stored | 29 // These objects are intended to be used as temporaries rather than stored |
30 // anywhere, so the use of non-const reference parameters is likely to cause | 30 // anywhere, so the use of non-const reference parameters is likely to cause |
31 // less confusion than usual. | 31 // less confusion than usual. |
32 | 32 |
33 #ifndef CHROME_COMMON_EXTENSIONS_VALUE_BUILDER_H_ | 33 #ifndef EXTENSIONS_COMMON_VALUE_BUILDER_H_ |
34 #define CHROME_COMMON_EXTENSIONS_VALUE_BUILDER_H_ | 34 #define EXTENSIONS_COMMON_VALUE_BUILDER_H_ |
35 | 35 |
36 #include <string> | 36 #include <string> |
37 | 37 |
38 #include "base/memory/scoped_ptr.h" | 38 #include "base/memory/scoped_ptr.h" |
39 #include "base/strings/string16.h" | 39 #include "base/strings/string16.h" |
40 #include "base/values.h" | 40 #include "base/values.h" |
41 | 41 |
42 namespace extensions { | 42 namespace extensions { |
43 | 43 |
44 class ListBuilder; | 44 class ListBuilder; |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 // Named differently because overload resolution is too eager to | 94 // Named differently because overload resolution is too eager to |
95 // convert implicitly to bool. | 95 // convert implicitly to bool. |
96 ListBuilder& AppendBoolean(bool in_value); | 96 ListBuilder& AppendBoolean(bool in_value); |
97 | 97 |
98 private: | 98 private: |
99 scoped_ptr<base::ListValue> list_; | 99 scoped_ptr<base::ListValue> list_; |
100 }; | 100 }; |
101 | 101 |
102 } // namespace extensions | 102 } // namespace extensions |
103 | 103 |
104 #endif // CHROME_COMMON_EXTENSIONS_VALUE_BUILDER_H_ | 104 #endif // EXTENSIONS_COMMON_VALUE_BUILDER_H_ |
OLD | NEW |