| 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> |
| 11 | 11 |
| 12 #include <memory> | 12 #include <memory> |
| 13 #include <string> | 13 #include <string> |
| 14 #include <vector> | 14 #include <vector> |
| 15 | 15 |
| 16 #include "base/files/scoped_file.h" |
| 16 #include "base/macros.h" | 17 #include "base/macros.h" |
| 17 #include "dbus/dbus_export.h" | 18 #include "dbus/dbus_export.h" |
| 18 #include "dbus/file_descriptor.h" | 19 #include "dbus/file_descriptor.h" |
| 19 #include "dbus/object_path.h" | 20 #include "dbus/object_path.h" |
| 20 | 21 |
| 21 namespace google { | 22 namespace google { |
| 22 namespace protobuf { | 23 namespace protobuf { |
| 23 | 24 |
| 24 class MessageLite; | 25 class MessageLite; |
| 25 | 26 |
| (...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 278 void AppendBool(bool value); | 279 void AppendBool(bool value); |
| 279 void AppendInt16(int16_t value); | 280 void AppendInt16(int16_t value); |
| 280 void AppendUint16(uint16_t value); | 281 void AppendUint16(uint16_t value); |
| 281 void AppendInt32(int32_t value); | 282 void AppendInt32(int32_t value); |
| 282 void AppendUint32(uint32_t value); | 283 void AppendUint32(uint32_t value); |
| 283 void AppendInt64(int64_t value); | 284 void AppendInt64(int64_t value); |
| 284 void AppendUint64(uint64_t value); | 285 void AppendUint64(uint64_t value); |
| 285 void AppendDouble(double value); | 286 void AppendDouble(double value); |
| 286 void AppendString(const std::string& value); | 287 void AppendString(const std::string& value); |
| 287 void AppendObjectPath(const ObjectPath& value); | 288 void AppendObjectPath(const ObjectPath& value); |
| 289 |
| 290 // Appends a file descriptor to the message. |
| 291 // The FD will be duplicated so you still have to close the original FD. |
| 292 void AppendFileDescriptor(int value); |
| 293 |
| 294 // DEPRECATED: Use the method with the same name above instead. |
| 295 // TODO(hashimoto): Remove this. crbug.com/621841 |
| 288 void AppendFileDescriptor(const FileDescriptor& value); | 296 void AppendFileDescriptor(const FileDescriptor& value); |
| 289 | 297 |
| 290 // Opens an array. The array contents can be added to the array with | 298 // Opens an array. The array contents can be added to the array with |
| 291 // |sub_writer|. The client code must close the array with | 299 // |sub_writer|. The client code must close the array with |
| 292 // CloseContainer(), once all contents are added. | 300 // CloseContainer(), once all contents are added. |
| 293 // | 301 // |
| 294 // |signature| parameter is used to supply the D-Bus type signature of | 302 // |signature| parameter is used to supply the D-Bus type signature of |
| 295 // the array contents. For instance, if you want an array of strings, | 303 // the array contents. For instance, if you want an array of strings, |
| 296 // then you pass "s" as the signature. | 304 // then you pass "s" as the signature. |
| 297 // | 305 // |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 391 bool PopBool(bool* value); | 399 bool PopBool(bool* value); |
| 392 bool PopInt16(int16_t* value); | 400 bool PopInt16(int16_t* value); |
| 393 bool PopUint16(uint16_t* value); | 401 bool PopUint16(uint16_t* value); |
| 394 bool PopInt32(int32_t* value); | 402 bool PopInt32(int32_t* value); |
| 395 bool PopUint32(uint32_t* value); | 403 bool PopUint32(uint32_t* value); |
| 396 bool PopInt64(int64_t* value); | 404 bool PopInt64(int64_t* value); |
| 397 bool PopUint64(uint64_t* value); | 405 bool PopUint64(uint64_t* value); |
| 398 bool PopDouble(double* value); | 406 bool PopDouble(double* value); |
| 399 bool PopString(std::string* value); | 407 bool PopString(std::string* value); |
| 400 bool PopObjectPath(ObjectPath* value); | 408 bool PopObjectPath(ObjectPath* value); |
| 409 bool PopFileDescriptor(base::ScopedFD* value); |
| 410 |
| 411 // DEPRECATED: Use the method with the same name above. |
| 412 // TODO(hashimoto): Remove this. crbug.com/621841 |
| 401 bool PopFileDescriptor(FileDescriptor* value); | 413 bool PopFileDescriptor(FileDescriptor* value); |
| 402 | 414 |
| 403 // Sets up the given message reader to read an array at the current | 415 // Sets up the given message reader to read an array at the current |
| 404 // iterator position. | 416 // iterator position. |
| 405 // Returns true and advances the iterator on success. | 417 // Returns true and advances the iterator on success. |
| 406 // Returns false if the data type is not an array | 418 // Returns false if the data type is not an array |
| 407 bool PopArray(MessageReader* sub_reader); | 419 bool PopArray(MessageReader* sub_reader); |
| 408 bool PopStruct(MessageReader* sub_reader); | 420 bool PopStruct(MessageReader* sub_reader); |
| 409 bool PopDictEntry(MessageReader* sub_reader); | 421 bool PopDictEntry(MessageReader* sub_reader); |
| 410 bool PopVariant(MessageReader* sub_reader); | 422 bool PopVariant(MessageReader* sub_reader); |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 494 | 506 |
| 495 Message* message_; | 507 Message* message_; |
| 496 DBusMessageIter raw_message_iter_; | 508 DBusMessageIter raw_message_iter_; |
| 497 | 509 |
| 498 DISALLOW_COPY_AND_ASSIGN(MessageReader); | 510 DISALLOW_COPY_AND_ASSIGN(MessageReader); |
| 499 }; | 511 }; |
| 500 | 512 |
| 501 } // namespace dbus | 513 } // namespace dbus |
| 502 | 514 |
| 503 #endif // DBUS_MESSAGE_H_ | 515 #endif // DBUS_MESSAGE_H_ |
| OLD | NEW |