blob: 6969b8b6d9e77fb4a5b425fb9a5253a82f89dbf1 [file] [log] [blame]
Ed Tanousc9b55212017-06-12 13:25:51 -07001// 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
11namespace dbus {
12
13class message;
14
15namespace impl {
16
17class 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();
Ed Tanous4d92cbf2017-06-22 15:41:02 -070037 char get_arg_type();
38 int get_element_count();
Ed Tanousc9b55212017-06-12 13:25:51 -070039
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