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
27EDELIB_NS_BEGIN
28
34struct 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
121struct 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
157
161 bool operator==(const EdbusDict& other);
162
166 bool operator!=(const EdbusDict& other) { return !operator==(other); }
167
172
177
182
187
192 const_iterator end(void) const;
193
197 unsigned int size(void) const;
198};
199
200EDELIB_NS_END
201#endif
Abstract container for D-Bus containers.
Definition: EdbusContainer.h:52
Class for representing D-Bus data types.
Definition: EdbusData.h:110
EdbusDataType
Type of data current EdbusData object holds.
Definition: EdbusData.h:41
An entry in EdbusDict.
Definition: EdbusDict.h:34
bool operator!=(const EdbusDictEntry &other) const
Definition: EdbusDict.h:52
bool operator==(const EdbusDictEntry &other) const
Definition: EdbusDict.h:43
EdbusData value
Definition: EdbusDict.h:38
EdbusData key
Definition: EdbusDict.h:36
Dictionary container for D-Bus types.
Definition: EdbusDict.h:121
const_iterator end(void) const
EdbusData find(const EdbusData &key)
EdbusDataType key_type(void)
EdbusContainer< EdbusDictEntry >::const_iterator const_iterator
Definition: EdbusDict.h:125
bool operator==(const EdbusDict &other)
void append(const EdbusData &key, const EdbusData &value)
EdbusDataType value_type(void)
bool value_type_is_container(void)
void remove(const EdbusData &key)
const_iterator begin(void) const
bool operator!=(const EdbusDict &other)
Definition: EdbusDict.h:166
void clear(void)
unsigned int size(void) const