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 #ifndef DBUS_MESSAGE_H_ | 5 #ifndef DBUS_MESSAGE_H_ |
6 #define DBUS_MESSAGE_H_ | 6 #define DBUS_MESSAGE_H_ |
7 | 7 |
8 #include <dbus/dbus.h> | 8 #include <dbus/dbus.h> |
9 #include <stddef.h> | 9 #include <stddef.h> |
10 #include <stdint.h> | 10 #include <stdint.h> |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 | 327 |
328 // Appends the array of object paths. Arrays of object paths are often | 328 // Appends the array of object paths. Arrays of object paths are often |
329 // used when exchanging object paths, hence it's worth having a | 329 // used when exchanging object paths, hence it's worth having a |
330 // specialized function. | 330 // specialized function. |
331 void AppendArrayOfObjectPaths(const std::vector<ObjectPath>& object_paths); | 331 void AppendArrayOfObjectPaths(const std::vector<ObjectPath>& object_paths); |
332 | 332 |
333 // Appends the protocol buffer as an array of bytes. The buffer is serialized | 333 // Appends the protocol buffer as an array of bytes. The buffer is serialized |
334 // into an array of bytes before communication, since protocol buffers are not | 334 // into an array of bytes before communication, since protocol buffers are not |
335 // a native dbus type. On the receiving size the array of bytes needs to be | 335 // a native dbus type. On the receiving size the array of bytes needs to be |
336 // read and deserialized into a protocol buffer of the correct type. There are | 336 // read and deserialized into a protocol buffer of the correct type. There are |
337 // methods in MessageReader to assist in this. Return true on succes and fail | 337 // methods in MessageReader to assist in this. Return true on success and |
338 // when serialization is not successful. | 338 // false when serialization fails. |
339 bool AppendProtoAsArrayOfBytes(const google::protobuf::MessageLite& protobuf); | 339 bool AppendProtoAsArrayOfBytes(const google::protobuf::MessageLite& protobuf); |
340 | 340 |
341 // Appends the byte wrapped in a variant data container. Variants are | 341 // Appends the byte wrapped in a variant data container. Variants are |
342 // widely used in D-Bus services so it's worth having a specialized | 342 // widely used in D-Bus services so it's worth having a specialized |
343 // function. For instance, The third parameter of | 343 // function. For instance, The third parameter of |
344 // "org.freedesktop.DBus.Properties.Set" is a variant. | 344 // "org.freedesktop.DBus.Properties.Set" is a variant. |
345 void AppendVariantOfByte(uint8_t value); | 345 void AppendVariantOfByte(uint8_t value); |
346 void AppendVariantOfBool(bool value); | 346 void AppendVariantOfBool(bool value); |
347 void AppendVariantOfInt16(int16_t value); | 347 void AppendVariantOfInt16(int16_t value); |
348 void AppendVariantOfUint16(uint16_t value); | 348 void AppendVariantOfUint16(uint16_t value); |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 | 497 |
498 Message* message_; | 498 Message* message_; |
499 DBusMessageIter raw_message_iter_; | 499 DBusMessageIter raw_message_iter_; |
500 | 500 |
501 DISALLOW_COPY_AND_ASSIGN(MessageReader); | 501 DISALLOW_COPY_AND_ASSIGN(MessageReader); |
502 }; | 502 }; |
503 | 503 |
504 } // namespace dbus | 504 } // namespace dbus |
505 | 505 |
506 #endif // DBUS_MESSAGE_H_ | 506 #endif // DBUS_MESSAGE_H_ |
OLD | NEW |