00001 /*************************************************************************** 00002 * Copyright (C) 2009 by Rick L. Vinyard, Jr. * 00003 * rvinyard@cs.nmsu.edu * 00004 * * 00005 * This file is part of the dbus-cxx library. * 00006 * * 00007 * The dbus-cxx library is free software; you can redistribute it and/or * 00008 * modify it under the terms of the GNU General Public License * 00009 * version 3 as published by the Free Software Foundation. * 00010 * * 00011 * The dbus-cxx library is distributed in the hope that it will be * 00012 * useful, but WITHOUT ANY WARRANTY; without even the implied warranty * 00013 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * 00014 * General Public License for more details. * 00015 * * 00016 * You should have received a copy of the GNU General Public License * 00017 * along with this software. If not see <http://www.gnu.org/licenses/>. * 00018 ***************************************************************************/ 00019 #ifndef DBUSCXXSIGNATUREITERATOR_H 00020 #define DBUSCXXSIGNATUREITERATOR_H 00021 00022 #include <string> 00023 #include <vector> 00024 00025 #include <dbus/dbus.h> 00026 00027 #include <dbus-cxx/enums.h> 00028 #include <dbus-cxx/error.h> 00029 #include <dbus-cxx/pointer.h> 00030 00031 00032 namespace DBus 00033 { 00034 00042 class SignatureIterator 00043 { 00044 public: 00045 00046 SignatureIterator(); 00047 00048 SignatureIterator( const std::string& signature ); 00049 00051 DBusSignatureIter* cobj(); 00052 00054 bool init( const std::string& signature ); 00055 00057 void invalidate(); 00058 00060 bool is_valid() const; 00061 00063 operator bool() const; 00064 00070 bool next(); 00071 00072 SignatureIterator& operator ++(); 00073 00074 SignatureIterator operator ++( int ); 00075 00076 bool operator==( const SignatureIterator& other ); 00077 00079 Type type() const; 00080 00086 Type element_type() const; 00087 00089 bool is_basic() const; 00090 00092 bool is_fixed() const; 00093 00095 bool is_container() const; 00096 00098 bool is_array() const; 00099 00101 bool is_dict() const; 00102 00108 SignatureIterator recurse(); 00109 00111 std::string signature() const; 00112 00113 protected: 00114 DBusSignatureIter m_cobj; 00115 00116 bool m_valid; 00117 00118 }; 00119 00120 } 00121 00122 #endif