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 
171  EdbusDataType key_type(void);
172 
176  EdbusDataType value_type(void);
177 
181  bool value_type_is_container(void);
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
bool operator==(const EdbusDictEntry &other) const
Definition: EdbusDict.h:43
Class for representing D-Bus data types.
Definition: EdbusData.h:110
bool operator!=(const EdbusDictEntry &other) const
Definition: EdbusDict.h:52
EdbusData value
Definition: EdbusDict.h:38
bool operator!=(const EdbusDict &other)
Definition: EdbusDict.h:166
Dictionary container for D-Bus types.
Definition: EdbusDict.h:121
Abstract container for D-Bus containers.
Definition: EdbusContainer.h:52
An entry in EdbusDict.
Definition: EdbusDict.h:34
EdbusData key
Definition: EdbusDict.h:36
EdbusContainer< EdbusDictEntry >::const_iterator const_iterator
Definition: EdbusDict.h:125
EdbusDataType
Type of data current EdbusData object holds.
Definition: EdbusData.h:41