dbus-cxx logo
signatureiterator.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2009,2010 by Rick L. Vinyard, Jr. *
3  * rvinyard@cs.nmsu.edu *
4  * *
5  * This file is part of the dbus-cxx library. *
6  * *
7  * The dbus-cxx library is free software; you can redistribute it and/or *
8  * modify it under the terms of the GNU General Public License *
9  * version 3 as published by the Free Software Foundation. *
10  * *
11  * The dbus-cxx library is distributed in the hope that it will be *
12  * useful, but WITHOUT ANY WARRANTY; without even the implied warranty *
13  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
14  * General Public License for more details. *
15  * *
16  * You should have received a copy of the GNU General Public License *
17  * along with this software. If not see <http://www.gnu.org/licenses/>. *
18  ***************************************************************************/
19 #include <string>
20 #include <vector>
21 
22 #include <dbus/dbus.h>
23 
24 #include <dbus-cxx/enums.h>
25 #include <dbus-cxx/error.h>
26 #include <dbus-cxx/pointer.h>
27 
28 #ifndef DBUSCXX_SIGNATUREITERATOR_H
29 #define DBUSCXX_SIGNATUREITERATOR_H
30 
31 namespace DBus
32 {
33 
42  {
43  public:
44 
46 
47  SignatureIterator( const std::string& signature );
48 
50  DBusSignatureIter* cobj();
51 
53  bool init( const std::string& signature );
54 
56  void invalidate();
57 
59  bool is_valid() const;
60 
62  operator bool() const;
63 
69  bool next();
70 
72 
74 
75  bool operator==( const SignatureIterator& other );
76 
78  Type type() const;
79 
85  Type element_type() const;
86 
88  bool is_basic() const;
89 
91  bool is_fixed() const;
92 
94  bool is_container() const;
95 
97  bool is_array() const;
98 
100  bool is_dict() const;
101 
108 
110  std::string signature() const;
111 
112  protected:
113  DBusSignatureIter m_cobj;
114 
115  bool m_valid;
116 
117  };
118 
119 }
120 
121 #endif
bool is_basic() const
True if the element type is a basic type.
Definition: signatureiterator.cpp:129
Definition: accumulators.h:24
bool is_container() const
True if the iterator points to a container.
Definition: signatureiterator.cpp:139
bool is_dict() const
True if the iterator points to a dictionary.
Definition: signatureiterator.cpp:149
SignatureIterator()
Definition: signatureiterator.cpp:28
bool is_array() const
True if the iterator points to an array.
Definition: signatureiterator.cpp:144
SignatureIterator recurse()
If the iterator points to a container recurses into the container returning a sub-iterator.
Definition: signatureiterator.cpp:154
bool m_valid
Definition: signatureiterator.h:115
DBusSignatureIter * cobj()
Returns a pointer to the underlying DBusSignatureIter object.
Definition: signatureiterator.cpp:41
std::string signature() const
Returns the current signature of the iterator.
Definition: signatureiterator.cpp:167
bool operator==(const SignatureIterator &other)
Definition: signatureiterator.cpp:111
void invalidate()
Invalidates the iterator.
Definition: signatureiterator.cpp:64
bool is_valid() const
True if this is a valid iterator.
Definition: signatureiterator.cpp:70
bool init(const std::string &signature)
Initializes the iterator for the specified signature.
Definition: signatureiterator.cpp:46
Type element_type() const
Returns the element type of the array that the iterator points to.
Definition: signatureiterator.cpp:123
Type type() const
Returns the argument type that the iterator points to.
Definition: signatureiterator.cpp:116
DBusSignatureIter m_cobj
Definition: signatureiterator.h:113
Type
Definition: enums.h:41
Signature iterator allowing type signatures to be parsed.
Definition: signatureiterator.h:41
bool is_fixed() const
True if the element type is a fixed type.
Definition: signatureiterator.cpp:134
SignatureIterator & operator++()
Definition: signatureiterator.cpp:97
bool next()
Moves the iterator to the next field and invalidates it if it moves beyond the last field...
Definition: signatureiterator.cpp:80

Generated on Sun Mar 19 2017 14:54:27 for dbus-cxx by doxygen 1.8.8