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

Side by Side Diff: dbus/values_util.h

Issue 221393004: dbus/values_util.h: Add functions to append collection type values to message. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 8 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 | Annotate | Revision Log
OLDNEW
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 #ifndef DBUS_VALUES_UTIL_H_ 5 #ifndef DBUS_VALUES_UTIL_H_
6 #define DBUS_VALUES_UTIL_H_ 6 #define DBUS_VALUES_UTIL_H_
7 7
8 #include "dbus/dbus_export.h" 8 #include "dbus/dbus_export.h"
9 9
10 namespace base { 10 namespace base {
11 class Value; 11 class Value;
12 } 12 }
13 13
14 namespace dbus { 14 namespace dbus {
15 15
16 class MessageReader; 16 class MessageReader;
17 class MessageWriter; 17 class MessageWriter;
18 18
19 // Pops a value from |reader| as a base::Value. 19 // Pops a value from |reader| as a base::Value.
20 // Returns NULL if an error occurs. 20 // Returns NULL if an error occurs.
21 // Note: Integer values larger than int32 (including uint32) are converted to 21 // Note: Integer values larger than int32 (including uint32) are converted to
22 // double. Non-string diciontary keys are converted to strings. 22 // double. Non-string diciontary keys are converted to strings.
23 CHROME_DBUS_EXPORT base::Value* PopDataAsValue(MessageReader* reader); 23 CHROME_DBUS_EXPORT base::Value* PopDataAsValue(MessageReader* reader);
24 24
25 // Appends a basic type value to |writer|. 25 // DEPRECATED: Use AppendValueData instead.
26 // Appends a basic type value to |writer|. Basic types are BOOLEAN, INTEGER,
27 // DOUBLE, and STRING.
26 CHROME_DBUS_EXPORT void AppendBasicTypeValueData(MessageWriter* writer, 28 CHROME_DBUS_EXPORT void AppendBasicTypeValueData(MessageWriter* writer,
27 const base::Value& value); 29 const base::Value& value);
28 30
29 // Appends a basic type value to |writer| as a variant. 31 // DEPRECATED: Use AppendValueDataAsVariant instead.
32 // Appends a basic type value to |writer| as a variant. Basic types are BOOLEAN,
33 // INTEGER, DOUBLE, and STRING.
30 CHROME_DBUS_EXPORT void AppendBasicTypeValueDataAsVariant( 34 CHROME_DBUS_EXPORT void AppendBasicTypeValueDataAsVariant(
31 MessageWriter* writer, 35 MessageWriter* writer,
32 const base::Value& value); 36 const base::Value& value);
33 37
38 // Appends a value to |writer|. Value can be a basic type, as well as a
39 // collection type, such as dictionary or list. Collections will be written as
40 // variant containers, i.e. dictionaries will be written with type a{sv} and
41 // lists with type av.
42 CHROME_DBUS_EXPORT void AppendValueData(MessageWriter* writer,
43 const base::Value& value);
44
45 // Appends a value to |writer| as a variant. Value can be a basic type, as well
46 // as a collection type, such as dictionary or list. Collections will be written
47 // as variant containers, i.e. dictionaries will be written with type a{sv} and
48 // lists with type av.
49 CHROME_DBUS_EXPORT void AppendValueDataAsVariant(MessageWriter* writer,
50 const base::Value& value);
51
34 } // namespace dbus 52 } // namespace dbus
35 53
36 #endif // DBUS_VALUES_UTIL_H_ 54 #endif // DBUS_VALUES_UTIL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698