Dictionary_r Class Reference

Reentrant version of the dictionary. More...

#include <dictionary.h>

Inheritance diagram for Dictionary_r:
Dictionary zmm::Object Session

Public Member Functions

 Dictionary_r ()
void put (zmm::String key, zmm::String value)
 Adds a new key:value pair to the dictionary.
zmm::String get (zmm::String key)
 Returns the value for a given key.
void remove (zmm::String key)
 Deletes a key value pair.
zmm::String encode ()
 Returns an url encoded version of the whole dictionary.
void clear ()
 Removes all elements from the dictionary.
void decode (zmm::String url)
 Makes a dictionary out of url encoded data.
zmm::Ref< Dictionary_rclone ()
 Makes a shallow copy of the dictionary.
bool isSubsetOf (zmm::Ref< Dictionary > other)
bool equals (zmm::Ref< Dictionary > other)
zmm::Ref< zmm::Array
< DictionaryElement > > 
getElements ()
void optimize ()
 Frees unnecessary memory.
int size ()
 Returns the number of elements in the dictinary.
zmm::String encodeSimple ()
 It seems that a lot of devices can not cope with a param=value encoded URL, so we will use a simplified encoding scheme.
void decodeSimple (zmm::String url)
 Makes a dictionary out of simplified url encoded data.
void merge (zmm::Ref< Dictionary > other)
 Merge dictionary with another dictionary. If keys with the same name already exist, the existing ones will be overwritten.
bool isSubsetOf (zmm::Ref< Dictionary > other)
 returns true if the dictionary is a subset of another dictionary.#
bool equals (zmm::Ref< Dictionary > other)
 checks two dictionaries for equality
void retain ()
void release ()
int getRefCount ()

Static Public Member Functions

static void * operator new (size_t size)
static void operator delete (void *ptr)

Protected Member Functions

zmm::String _encode (char sep1, char sep2)
 Allow to specify encoding separators.

Protected Attributes

zmm::Ref< Mutexmutex
zmm::Ref< zmm::Array
< DictionaryElement > > 
elements
 Array of DictionaryElements, representing our Dictionary.
mt_atomic_t _ref_count

Detailed Description

Reentrant version of the dictionary.

Definition at line 126 of file dictionary.h.


Constructor & Destructor Documentation

Dictionary_r::Dictionary_r (  )  [inline]

Definition at line 129 of file dictionary.h.

References mutex.


Member Function Documentation

String Dictionary::_encode ( char  sep1,
char  sep2 
) [protected, inherited]

Allow to specify encoding separators.

Definition at line 122 of file dictionary.cc.

References Dictionary::elements, and url_escape().

Referenced by Dictionary::encode(), and Dictionary::encodeSimple().

void Dictionary_r::clear (  )  [inline]

Removes all elements from the dictionary.

Reimplemented from Dictionary.

Definition at line 164 of file dictionary.h.

References mutex.

zmm::Ref<Dictionary_r> Dictionary_r::clone (  )  [inline]

Makes a shallow copy of the dictionary.

Reimplemented from Dictionary.

Definition at line 178 of file dictionary.h.

References Dictionary::clone(), mutex, and RefCast.

void Dictionary_r::decode ( zmm::String  url  )  [inline]

Makes a dictionary out of url encoded data.

Reimplemented from Dictionary.

Definition at line 171 of file dictionary.h.

References mutex.

void Dictionary::decodeSimple ( zmm::String  url  )  [inherited]

Makes a dictionary out of simplified url encoded data.

Definition at line 174 of file dictionary.cc.

References zmm::String::index(), zmm::String::length(), Dictionary::put(), zmm::String::substring(), and url_unescape().

zmm::String Dictionary_r::encode (  )  [inline]

Returns an url encoded version of the whole dictionary.

Reimplemented from Dictionary.

Definition at line 156 of file dictionary.h.

References mutex.

String Dictionary::encodeSimple (  )  [inherited]

It seems that a lot of devices can not cope with a param=value encoded URL, so we will use a simplified encoding scheme.

Definition at line 142 of file dictionary.cc.

References Dictionary::_encode().

bool Dictionary::equals ( zmm::Ref< Dictionary other  )  [inherited]

checks two dictionaries for equality

Definition at line 242 of file dictionary.cc.

References Dictionary::isSubsetOf().

bool Dictionary_r::equals ( zmm::Ref< Dictionary other  )  [inline]

Definition at line 194 of file dictionary.h.

References mutex.

zmm::String Dictionary_r::get ( zmm::String  key  )  [inline]

Returns the value for a given key.

Reimplemented from Dictionary.

Definition at line 141 of file dictionary.h.

References mutex.

zmm::Ref<zmm::Array<DictionaryElement> > Dictionary_r::getElements (  )  [inline]

Reimplemented from Dictionary.

Definition at line 202 of file dictionary.h.

References mutex.

int Object::getRefCount (  )  [inherited]

Definition at line 78 of file object.cc.

References zmm::Object::_ref_count, and atomic_get().

bool Dictionary::isSubsetOf ( zmm::Ref< Dictionary other  )  [inherited]

returns true if the dictionary is a subset of another dictionary.#

Definition at line 231 of file dictionary.cc.

References Dictionary::elements.

Referenced by Dictionary::equals().

bool Dictionary_r::isSubsetOf ( zmm::Ref< Dictionary other  )  [inline]

Definition at line 186 of file dictionary.h.

References mutex.

void Dictionary::merge ( zmm::Ref< Dictionary other  )  [inherited]

Merge dictionary with another dictionary. If keys with the same name already exist, the existing ones will be overwritten.

Definition at line 217 of file dictionary.cc.

References nil, and Dictionary::put().

void Object::operator delete ( void *  ptr  )  [static, inherited]

Definition at line 87 of file object.cc.

References FREE.

void * Object::operator new ( size_t  size  )  [static, inherited]

Definition at line 83 of file object.cc.

References MALLOC.

void Dictionary_r::optimize (  )  [inline]

Frees unnecessary memory.

Reimplemented from Dictionary.

Definition at line 210 of file dictionary.h.

References mutex.

void Dictionary_r::put ( zmm::String  key,
zmm::String  value 
) [inline]

Adds a new key:value pair to the dictionary.

Reimplemented from Dictionary.

Definition at line 134 of file dictionary.h.

References mutex.

void Object::release (  )  [inherited]
void Dictionary_r::remove ( zmm::String  key  )  [inline]

Deletes a key value pair.

Reimplemented from Dictionary.

Definition at line 149 of file dictionary.h.

References mutex.

void Object::retain (  )  [inherited]
int Dictionary::size (  )  [inherited]

Returns the number of elements in the dictinary.

Definition at line 104 of file dictionary.cc.

References Dictionary::elements.


Field Documentation

mt_atomic_t zmm::Object::_ref_count [protected, inherited]

The documentation for this class was generated from the following file:

Generated on Fri Mar 26 20:16:56 2010 for MediaTomb by  doxygen 1.6.1