OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 #include <dbus/dbus.h> | 11 #include <dbus/dbus.h> |
12 | 12 |
13 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 14 #include "base/values.h" |
14 | 15 |
15 namespace dbus { | 16 namespace dbus { |
16 | 17 |
17 class MessageWriter; | 18 class MessageWriter; |
18 class MessageReader; | 19 class MessageReader; |
19 | 20 |
20 // Message is the base class of D-Bus message types. Client code must use | 21 // Message is the base class of D-Bus message types. Client code must use |
21 // sub classes such as MethodCall and Response instead. | 22 // sub classes such as MethodCall and Response instead. |
22 // | 23 // |
23 // The class name Message is very generic, but there should be no problem | 24 // The class name Message is very generic, but there should be no problem |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 bool PopArrayOfStrings(std::vector<std::string>* strings); | 386 bool PopArrayOfStrings(std::vector<std::string>* strings); |
386 | 387 |
387 // Gets the array of object paths at the current iterator position. | 388 // Gets the array of object paths at the current iterator position. |
388 // Returns true and advances the iterator on success. | 389 // Returns true and advances the iterator on success. |
389 // | 390 // |
390 // Arrays of object paths are often used to communicate with D-Bus | 391 // Arrays of object paths are often used to communicate with D-Bus |
391 // services like NetworkManager, hence it's worth having a specialized | 392 // services like NetworkManager, hence it's worth having a specialized |
392 // function. | 393 // function. |
393 bool PopArrayOfObjectPaths(std::vector<std::string>* object_paths); | 394 bool PopArrayOfObjectPaths(std::vector<std::string>* object_paths); |
394 | 395 |
| 396 // Gets the array of dict_entry objects at the current iterator position. |
| 397 // Returns true and advances the iterator on success. |
| 398 bool PopArrayOfDictEntries(DictionaryValue* dictionary); |
| 399 |
395 // Gets the byte from the variant data container at the current iterator | 400 // Gets the byte from the variant data container at the current iterator |
396 // position. | 401 // position. |
397 // Returns true and advances the iterator on success. | 402 // Returns true and advances the iterator on success. |
398 // | 403 // |
399 // Variants are widely used in D-Bus services so it's worth having a | 404 // Variants are widely used in D-Bus services so it's worth having a |
400 // specialized function. For instance, The return value type of | 405 // specialized function. For instance, The return value type of |
401 // "org.freedesktop.DBus.Properties.Get" is a variant. | 406 // "org.freedesktop.DBus.Properties.Get" is a variant. |
402 bool PopVariantOfByte(uint8* value); | 407 bool PopVariantOfByte(uint8* value); |
403 bool PopVariantOfBool(bool* value); | 408 bool PopVariantOfBool(bool* value); |
404 bool PopVariantOfInt16(int16* value); | 409 bool PopVariantOfInt16(int16* value); |
(...skipping 27 matching lines...) Expand all Loading... |
432 | 437 |
433 Message* message_; | 438 Message* message_; |
434 DBusMessageIter raw_message_iter_; | 439 DBusMessageIter raw_message_iter_; |
435 | 440 |
436 DISALLOW_COPY_AND_ASSIGN(MessageReader); | 441 DISALLOW_COPY_AND_ASSIGN(MessageReader); |
437 }; | 442 }; |
438 | 443 |
439 } // namespace dbus | 444 } // namespace dbus |
440 | 445 |
441 #endif // DBUS_MESSAGE_H_ | 446 #endif // DBUS_MESSAGE_H_ |
OLD | NEW |