edelib  2.1.0
EdbusDict.h
1 /*
2  * $Id: EdbusDict.h 3295 2012-05-15 12:52:41Z karijes $
3  *
4  * D-BUS stuff
5  * Copyright (c) 2008 edelib authors
6  *
7  * This library is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU Lesser General Public
9  * License as published by the Free Software Foundation; either
10  * version 2 of the License, or (at your option) any later version.
11  *
12  * This library is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  * Lesser General Public License for more details.
16  *
17  * You should have received a copy of the GNU Lesser General Public License
18  * along with this library. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef __EDELIB_EDBUSDICT_H__
22 #define __EDELIB_EDBUSDICT_H__
23 
24 #include "EdbusData.h"
25 #include "EdbusContainer.h"
26 
27 EDELIB_NS_BEGIN
28 
34 struct EDELIB_API EdbusDictEntry {
39 
43  bool operator==(const EdbusDictEntry& other) const {
44  if(key == other.key && value == other.value)
45  return true;
46  return false;
47  }
48 
52  bool operator!=(const EdbusDictEntry& other) const { return !operator==(other); }
53 };
54 
121 struct EDELIB_API EdbusDict : public EdbusContainer<EdbusDictEntry> {
126 
134  void append(const EdbusData& key, const EdbusData& value);
135 
139  void clear(void);
140 
147  void remove(const EdbusData& key);
148 
156  EdbusData find(const EdbusData& key);
157 
161  bool operator==(const EdbusDict& other);
162 
166  bool operator!=(const EdbusDict& other) { return !operator==(other); }
167 
172 
177 
182 
186  const_iterator begin(void) const;
187 
192  const_iterator end(void) const;
193 
197  unsigned int size(void) const;
198 };
199 
200 EDELIB_NS_END
201 #endif
edelib::EdbusDict::find
EdbusData find(const EdbusData &key)
edelib::EdbusDictEntry::value
EdbusData value
Definition: EdbusDict.h:38
edelib::EdbusDict::append
void append(const EdbusData &key, const EdbusData &value)
edelib::EdbusDict::operator==
bool operator==(const EdbusDict &other)
edelib::EdbusDictEntry::operator!=
bool operator!=(const EdbusDictEntry &other) const
Definition: EdbusDict.h:52
edelib::EdbusDict::const_iterator
EdbusContainer< EdbusDictEntry >::const_iterator const_iterator
Definition: EdbusDict.h:125
edelib::EdbusDict::remove
void remove(const EdbusData &key)
edelib::EdbusDict::begin
const_iterator begin(void) const
edelib::EdbusDictEntry::operator==
bool operator==(const EdbusDictEntry &other) const
Definition: EdbusDict.h:43
edelib::EdbusDictEntry::key
EdbusData key
Definition: EdbusDict.h:36
edelib::EdbusDict::operator!=
bool operator!=(const EdbusDict &other)
Definition: EdbusDict.h:166
edelib::EdbusDictEntry
An entry in EdbusDict.
Definition: EdbusDict.h:34
edelib::EdbusDict::key_type
EdbusDataType key_type(void)
edelib::EdbusContainer
Abstract container for D-Bus containers.
Definition: EdbusContainer.h:52
edelib::EdbusDict::value_type
EdbusDataType value_type(void)
edelib::EdbusDict::value_type_is_container
bool value_type_is_container(void)
edelib::EdbusData
Class for representing D-Bus data types.
Definition: EdbusData.h:110
edelib::EdbusDataType
EdbusDataType
Type of data current EdbusData object holds.
Definition: EdbusData.h:41
edelib::EdbusDict::end
const_iterator end(void) const
edelib::EdbusDict::size
unsigned int size(void) const
edelib::EdbusDict::clear
void clear(void)
edelib::EdbusDict
Dictionary container for D-Bus types.
Definition: EdbusDict.h:121