1 // Copyright (c) Benjamin Kietzman (github.com/bkietz) 2 // 3 // Distributed under the Boost Software License, Version 1.0. (See accompanying 4 // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) 5 6 #ifndef DBUS_IMPL_MESSAGE_ITERATOR_HPP 7 #define DBUS_IMPL_MESSAGE_ITERATOR_HPP 8 9 #include <dbus/dbus.h> 10 11 namespace dbus { 12 13 class message; 14 15 namespace impl { 16 17 class message_iterator { 18 DBusMessageIter DBusMessageIter_; 19 20 public: 21 // writing 22 static void init_append(message &m, message_iterator &i); 23 24 void append_basic(int code, const void *value); 25 26 void open_container(int code, const char *signature, message_iterator &); 27 void close_container(message_iterator &); 28 void abandon_container(message_iterator &); 29 30 void append_fixed_array(int code, const void *value, int n_elements); 31 32 // reading 33 static bool init(message &m, message_iterator &i); 34 35 bool next(); 36 bool has_next(); 37 int get_arg_type(); 38 39 void get_basic(void *value); 40 41 void recurse(message_iterator &); 42 43 int get_element_type(); 44 void get_fixed_array(void *value, int *n_elements); 45 }; 46 47 } // namespace impl 48 } // namespace dbus 49 50 #endif // DBUS_IMPL_MESSAGE_ITERATOR_HPP 51