EdbusDict.h
/*
* $Id: EdbusDict.h 3295 2012-05-15 12:52:41Z karijes $
*
* D-BUS stuff
* Copyright (c) 2008 edelib authors
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __EDELIB_EDBUSDICT_H__
#define __EDELIB_EDBUSDICT_H__
#include "EdbusData.h"
#include "EdbusContainer.h"
EDELIB_NS_BEGIN
struct EDELIB_API EdbusDictEntry {
EdbusData key;
EdbusData value;
bool operator==(const EdbusDictEntry& other) const {
if(key == other.key && value == other.value)
return true;
return false;
}
bool operator!=(const EdbusDictEntry& other) const { return !operator==(other); }
};
struct EDELIB_API EdbusDict : public EdbusContainer<EdbusDictEntry> {
typedef EdbusContainer<EdbusDictEntry>::const_iterator const_iterator;
void append(const EdbusData& key, const EdbusData& value);
void clear(void);
void remove(const EdbusData& key);
EdbusData find(const EdbusData& key);
bool operator==(const EdbusDict& other);
bool operator!=(const EdbusDict& other) { return !operator==(other); }
EdbusDataType key_type(void);
EdbusDataType value_type(void);
bool value_type_is_container(void);
const_iterator begin(void) const;
const_iterator end(void) const;
unsigned int size(void) const;
};
EDELIB_NS_END
#endif
edelib::EdbusDictEntry::operator==
bool operator==(const EdbusDictEntry &other) const
Definition: EdbusDict.h:43
edelib::EdbusData
Class for representing D-Bus data types.
Definition: EdbusData.h:110
edelib::EdbusDictEntry::operator!=
bool operator!=(const EdbusDictEntry &other) const
Definition: EdbusDict.h:52
edelib::EdbusDictEntry::value
EdbusData value
Definition: EdbusDict.h:38
edelib::EdbusDict::operator!=
bool operator!=(const EdbusDict &other)
Definition: EdbusDict.h:166
edelib::EdbusDict
Dictionary container for D-Bus types.
Definition: EdbusDict.h:121
edelib::EdbusContainer
Abstract container for D-Bus containers.
Definition: EdbusContainer.h:52
edelib::EdbusDictEntry
An entry in EdbusDict.
Definition: EdbusDict.h:34
edelib::EdbusDictEntry::key
EdbusData key
Definition: EdbusDict.h:36
edelib::EdbusDict::const_iterator
EdbusContainer< EdbusDictEntry >::const_iterator const_iterator
Definition: EdbusDict.h:125
edelib::EdbusDataType
EdbusDataType
Type of data current EdbusData object holds.
Definition: EdbusData.h:41