summaryrefslogtreecommitdiffstats
path: root/dbus/values_util.h
blob: f710fa3758a3107e87cd4b45a59e0b2fadaba35f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef DBUS_VALUES_UTIL_H_
#define DBUS_VALUES_UTIL_H_

namespace base {
class Value;
}

namespace dbus {

class MessageReader;
class MessageWriter;

// Pops a value from |reader| as a base::Value.
// Returns NULL if an error occurs.
// Note: Integer values larger than int32 (including uint32) are converted to
// double.  Non-string diciontary keys are converted to strings.
base::Value* PopDataAsValue(MessageReader* reader);

// Appends a basic type value to |writer|.
void AppendBasicTypeValueData(MessageWriter* writer, const base::Value& value);

// Appends a basic type value to |writer| as a variant.
void AppendBasicTypeValueDataAsVariant(MessageWriter* writer,
                                       const base::Value& value);

}  // namespace dbus

#endif  // DBUS_VALUES_UTIL_H_