blob: 535a402d6213333467aae2477430e1f7d74861ac [file] [log] [blame]
hashimoto@chromium.org8fb5a2b2012-03-17 08:08:42 +09001// 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#ifndef DBUS_VALUES_UTIL_H_
6#define DBUS_VALUES_UTIL_H_
7#pragma once
8
9namespace base {
10class Value;
11}
12
13namespace dbus {
14
15class MessageReader;
hashimoto@chromium.orgea599822012-03-25 05:37:18 +090016class MessageWriter;
hashimoto@chromium.org8fb5a2b2012-03-17 08:08:42 +090017
18// Pops a value from |reader| as a base::Value.
19// Returns NULL if an error occurs.
20// Note: Integer values larger than int32 (including uint32) are converted to
21// double. Non-string diciontary keys are converted to strings.
22base::Value* PopDataAsValue(MessageReader* reader);
23
hashimoto@chromium.orgea599822012-03-25 05:37:18 +090024// Appends a basic type value to |writer|.
25void AppendBasicTypeValueData(MessageWriter* writer, const base::Value& value);
26
27// Appends a basic type value to |writer| as a variant.
28void AppendBasicTypeValueDataAsVariant(MessageWriter* writer,
29 const base::Value& value);
30
hashimoto@chromium.org8fb5a2b2012-03-17 08:08:42 +090031} // namespace dbus
32
33#endif // DBUS_VALUES_UTIL_H_