hashimoto@chromium.org | 8fb5a2b | 2012-03-17 08:08:42 +0900 | [diff] [blame] | 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 | #ifndef DBUS_VALUES_UTIL_H_ |
| 6 | #define DBUS_VALUES_UTIL_H_ |
| 7 | #pragma once |
| 8 | |
| 9 | namespace base { |
| 10 | class Value; |
| 11 | } |
| 12 | |
| 13 | namespace dbus { |
| 14 | |
| 15 | class MessageReader; |
hashimoto@chromium.org | ea59982 | 2012-03-25 05:37:18 +0900 | [diff] [blame^] | 16 | class MessageWriter; |
hashimoto@chromium.org | 8fb5a2b | 2012-03-17 08:08:42 +0900 | [diff] [blame] | 17 | |
| 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. |
| 22 | base::Value* PopDataAsValue(MessageReader* reader); |
| 23 | |
hashimoto@chromium.org | ea59982 | 2012-03-25 05:37:18 +0900 | [diff] [blame^] | 24 | // Appends a basic type value to |writer|. |
| 25 | void AppendBasicTypeValueData(MessageWriter* writer, const base::Value& value); |
| 26 | |
| 27 | // Appends a basic type value to |writer| as a variant. |
| 28 | void AppendBasicTypeValueDataAsVariant(MessageWriter* writer, |
| 29 | const base::Value& value); |
| 30 | |
hashimoto@chromium.org | 8fb5a2b | 2012-03-17 08:08:42 +0900 | [diff] [blame] | 31 | } // namespace dbus |
| 32 | |
| 33 | #endif // DBUS_VALUES_UTIL_H_ |