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