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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 void OpenDictEntry(MessageWriter* sub_writer); | 305 void OpenDictEntry(MessageWriter* sub_writer); |
306 | 306 |
307 // Close the container for a array/variant/struct/dict entry. | 307 // Close the container for a array/variant/struct/dict entry. |
308 void CloseContainer(MessageWriter* sub_writer); | 308 void CloseContainer(MessageWriter* sub_writer); |
309 | 309 |
310 // Appends the array of bytes. Arrays of bytes are often used for | 310 // Appends the array of bytes. Arrays of bytes are often used for |
311 // exchanging binary blobs hence it's worth having a specialized | 311 // exchanging binary blobs hence it's worth having a specialized |
312 // function. | 312 // function. |
313 void AppendArrayOfBytes(const uint8_t* values, size_t length); | 313 void AppendArrayOfBytes(const uint8_t* values, size_t length); |
314 | 314 |
| 315 // Appends the array of doubles. Used for audio mixer matrix doubles. |
| 316 void AppendArrayOfDoubles(const double* values, size_t length); |
| 317 |
315 // Appends the array of strings. Arrays of strings are often used for | 318 // Appends the array of strings. Arrays of strings are often used for |
316 // exchanging lists of names hence it's worth having a specialized | 319 // exchanging lists of names hence it's worth having a specialized |
317 // function. | 320 // function. |
318 void AppendArrayOfStrings(const std::vector<std::string>& strings); | 321 void AppendArrayOfStrings(const std::vector<std::string>& strings); |
319 | 322 |
320 // Appends the array of object paths. Arrays of object paths are often | 323 // Appends the array of object paths. Arrays of object paths are often |
321 // used when exchanging object paths, hence it's worth having a | 324 // used when exchanging object paths, hence it's worth having a |
322 // specialized function. | 325 // specialized function. |
323 void AppendArrayOfObjectPaths(const std::vector<ObjectPath>& object_paths); | 326 void AppendArrayOfObjectPaths(const std::vector<ObjectPath>& object_paths); |
324 | 327 |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
408 // Returns true and advances the iterator on success. | 411 // Returns true and advances the iterator on success. |
409 // | 412 // |
410 // Arrays of bytes are often used for exchanging binary blobs hence it's | 413 // Arrays of bytes are often used for exchanging binary blobs hence it's |
411 // worth having a specialized function. | 414 // worth having a specialized function. |
412 // | 415 // |
413 // Ownership of the memory pointed to by |bytes| remains with the | 416 // Ownership of the memory pointed to by |bytes| remains with the |
414 // MessageReader; |bytes| must be copied if the contents will be referenced | 417 // MessageReader; |bytes| must be copied if the contents will be referenced |
415 // after the MessageReader is destroyed. | 418 // after the MessageReader is destroyed. |
416 bool PopArrayOfBytes(const uint8_t** bytes, size_t* length); | 419 bool PopArrayOfBytes(const uint8_t** bytes, size_t* length); |
417 | 420 |
| 421 // Gets the array of doubles at the current iterator position. |
| 422 bool PopArrayOfDoubles(const double** doubles, size_t* length); |
| 423 |
418 // Gets the array of strings at the current iterator position. |strings| is | 424 // Gets the array of strings at the current iterator position. |strings| is |
419 // cleared before being modified. Returns true and advances the iterator on | 425 // cleared before being modified. Returns true and advances the iterator on |
420 // success. | 426 // success. |
421 // | 427 // |
422 // Arrays of strings are often used to communicate with D-Bus | 428 // Arrays of strings are often used to communicate with D-Bus |
423 // services like KWallet, hence it's worth having a specialized | 429 // services like KWallet, hence it's worth having a specialized |
424 // function. | 430 // function. |
425 bool PopArrayOfStrings(std::vector<std::string>* strings); | 431 bool PopArrayOfStrings(std::vector<std::string>* strings); |
426 | 432 |
427 // Gets the array of object paths at the current iterator position. | 433 // Gets the array of object paths at the current iterator position. |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 | 492 |
487 Message* message_; | 493 Message* message_; |
488 DBusMessageIter raw_message_iter_; | 494 DBusMessageIter raw_message_iter_; |
489 | 495 |
490 DISALLOW_COPY_AND_ASSIGN(MessageReader); | 496 DISALLOW_COPY_AND_ASSIGN(MessageReader); |
491 }; | 497 }; |
492 | 498 |
493 } // namespace dbus | 499 } // namespace dbus |
494 | 500 |
495 #endif // DBUS_MESSAGE_H_ | 501 #endif // DBUS_MESSAGE_H_ |
OLD | NEW |