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   bool append_basic(int code, const void *value);
25 
26   bool open_container(int code, const char *signature, message_iterator &);
27   bool close_container(message_iterator &);
28   void abandon_container(message_iterator &);
29 
30   bool 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   char get_arg_type();
38   int get_element_count();
39 
40   void get_basic(void *value);
41 
42   void recurse(message_iterator &);
43 
44   int get_element_type();
45   void get_fixed_array(void *value, int *n_elements);
46 };
47 
48 }  // namespace impl
49 }  // namespace dbus
50 
51 #endif  // DBUS_IMPL_MESSAGE_ITERATOR_HPP
52