21 #ifndef DBUSCXX_SIGNATURE_H
22 #define DBUSCXX_SIGNATURE_H
24 #define DBUSCXX_TYPE_INVALID_AS_STRING "\0"
25 #define DBUSCXX_TYPE_BYTE_AS_STRING "y"
26 #define DBUSCXX_TYPE_BOOLEAN_AS_STRING "b"
27 #define DBUSCXX_TYPE_INT16_AS_STRING "n"
28 #define DBUSCXX_TYPE_UINT16_AS_STRING "q"
29 #define DBUSCXX_TYPE_INT32_AS_STRING "i"
30 #define DBUSCXX_TYPE_UINT32_AS_STRING "u"
31 #define DBUSCXX_TYPE_INT64_AS_STRING "x"
32 #define DBUSCXX_TYPE_UINT64_AS_STRING "t"
33 #define DBUSCXX_TYPE_DOUBLE_AS_STRING "d"
34 #define DBUSCXX_TYPE_STRING_AS_STRING "s"
35 #define DBUSCXX_TYPE_SIGNATURE_AS_STRING "g"
36 #define DBUSCXX_TYPE_OBJECT_PATH_AS_STRING "o"
37 #define DBUSCXX_TYPE_VARIANT_AS_STRING "v"
38 #define DBUSCXX_TYPE_UNIX_FD_AS_STRING "h"
39 #define DBUSCXX_TYPE_ARRAY_AS_STRING "a"
40 #define DBUSCXX_DICT_ENTRY_BEGIN_CHAR_AS_STRING "{"
41 #define DBUSCXX_DICT_ENTRY_END_CHAR_AS_STRING "}"
42 #define DBUSCXX_STRUCT_BEGIN_CHAR_AS_STRING "("
43 #define DBUSCXX_STRUCT_END_CHAR_AS_STRING ")"
59 std::shared_ptr<priv::SignatureNode>
m_next;
60 std::shared_ptr<priv::SignatureNode>
m_sub;
100 operator const std::string& ()
const;
102 const std::string&
str()
const;
129 void print_tree( std::ostream* stream )
const;
135 std::stack<ContainerType>* container_stack,
146 template <
typename... T>
147 inline std::string
signature(
const std::tuple<T...>& );
163 template<
typename... T>
169 template <
typename Key,
typename Data>
inline std::string
signature(
const std::map<Key, Data>& ) {
183 template <
typename Key,
typename Data>
inline std::string
signature_dict_data(
const std::map<Key, Data>& ) {
192 template<
typename... T_arg>
199 template<
typename... argn>
209 template<
typename arg1,
typename... argn>
220 template<
typename... T_arg>
221 inline std::string
signature(
const std::tuple<T_arg...>& ) {
229 template<
typename... T_arg>
233 return sig.dbus_sig();
238 sout <<
"DBus::Signature[" << sig.
str() <<
"]";
A FileDescriptor holds a UNIX file descriptor that can be passed between processes.
Definition: filedescriptor.h:21
Definition: multiplereturn.h:29
Represents a DBus Path.
Definition: path.h:21
A SignatureIterator allows you to iterate over a given DBus signature, and to extract useful informat...
Definition: signatureiterator.h:33
Represents a DBus signature.
Definition: signature.h:74
SignatureIterator iterator
Definition: signature.h:77
void print_tree(std::ostream *stream) const
Print the signature tree to the given ostream.
Definition: signature.cpp:249
const std::string & str() const
Definition: signature.cpp:66
iterator end()
Definition: signature.cpp:92
std::shared_ptr< priv_data > m_priv
Definition: signature.h:141
bool is_singleton() const
True if the signature is a valid DBus signature and contains exactly one complete type.
Definition: signature.cpp:104
void print_node(std::ostream *stream, priv::SignatureNode *node, int spaces) const
Definition: signature.cpp:264
~Signature()
Definition: signature.cpp:59
void initialize()
Definition: signature.cpp:277
const SignatureIterator const_iterator
Definition: signature.h:79
std::shared_ptr< priv::SignatureNode > create_signature_tree(std::string::const_iterator *it, std::stack< ContainerType > *container_stack, bool *ok)
Definition: signature.cpp:111
bool is_valid() const
True if the signature is a valid DBus signature.
Definition: signature.cpp:100
Signature & operator=(const std::string &s)
Definition: signature.cpp:70
bool operator==(const std::string &s) const
Definition: signature.h:108
Signature()
Definition: signature.cpp:31
std::string::size_type size_type
Definition: signature.h:81
iterator begin()
Definition: signature.cpp:80
static const size_type npos
Definition: signature.h:83
A Variant is a type-safe union for DBus operations.
Definition: variant.h:42
Represents a single entry in our graph of the signature.
Definition: signature.h:51
DataType m_dataType
Definition: signature.h:58
std::shared_ptr< priv::SignatureNode > m_next
Definition: signature.h:59
std::shared_ptr< priv::SignatureNode > m_sub
Definition: signature.h:60
SignatureNode(DataType d)
Definition: signature.h:53
std::string dbus_sig() const
Definition: signature.h:212
std::string dbus_sig() const
Definition: signature.h:204
Definition: signature.h:200
Global DBus namespace, where everything happens.
Definition: callmessage.cpp:18
std::string signature_multiple_return_data(const DBus::MultipleReturn< T_arg... > &)
Definition: signature.h:230
std::string signature_dict_data(const std::map< Key, Data > &)
Definition: signature.h:183
std::shared_ptr< DBus::Connection > operator<<(std::shared_ptr< DBus::Connection > ptr, std::shared_ptr< DBus::Message > msg)
Definition: connection.h:431
const Signature::size_type npos
Definition: signature.cpp:18
DataType
Definition: enums.h:52
std::string signature(const std::tuple< T... > &)
#define DBUSCXX_TYPE_DOUBLE_AS_STRING
Definition: signature.h:33
#define DBUSCXX_STRUCT_END_CHAR_AS_STRING
Definition: signature.h:43
#define DBUSCXX_STRUCT_BEGIN_CHAR_AS_STRING
Definition: signature.h:42
#define DBUSCXX_TYPE_INVALID_AS_STRING
Definition: signature.h:24
#define DBUSCXX_TYPE_INT16_AS_STRING
Definition: signature.h:27
#define DBUSCXX_TYPE_BYTE_AS_STRING
Definition: signature.h:25
#define DBUSCXX_TYPE_INT32_AS_STRING
Definition: signature.h:29
#define DBUSCXX_TYPE_ARRAY_AS_STRING
Definition: signature.h:39
#define DBUSCXX_TYPE_SIGNATURE_AS_STRING
Definition: signature.h:35
#define DBUSCXX_TYPE_VARIANT_AS_STRING
Definition: signature.h:37
#define DBUSCXX_TYPE_BOOLEAN_AS_STRING
Definition: signature.h:26
#define DBUSCXX_TYPE_STRING_AS_STRING
Definition: signature.h:34
#define DBUSCXX_DICT_ENTRY_END_CHAR_AS_STRING
Definition: signature.h:41
#define DBUSCXX_TYPE_UINT64_AS_STRING
Definition: signature.h:32
#define DBUSCXX_TYPE_UINT16_AS_STRING
Definition: signature.h:28
#define DBUSCXX_TYPE_OBJECT_PATH_AS_STRING
Definition: signature.h:36
#define DBUSCXX_DICT_ENTRY_BEGIN_CHAR_AS_STRING
Definition: signature.h:40
#define DBUSCXX_TYPE_UNIX_FD_AS_STRING
Definition: signature.h:38
#define DBUSCXX_TYPE_INT64_AS_STRING
Definition: signature.h:31
#define DBUSCXX_TYPE_UINT32_AS_STRING
Definition: signature.h:30