Dictionary is a class like NSDictionary in Obj-C . More...
#include <CCDictionary.h>
Public Member Functions | |
__Dictionary () | |
The constructor of Dictionary. More... | |
~__Dictionary () | |
The destructor of Dictionary. More... | |
bool | init () |
Initializes the dictionary. More... | |
unsigned int | count () |
Get the count of elements in Dictionary. More... | |
local | count () |
Get the count of elements in Dictionary. More... | |
__Array * | allKeys () |
Return all keys of elements. More... | |
__Array * | allKeysForObject (Ref *object) |
Get all keys according to the specified object. More... | |
local | allKeysForObject ( local object) |
Get all keys according to the specified object. More... | |
Ref * | objectForKey (const std::string &key) |
Get the object according to the specified string key. More... | |
Ref * | objectForKey (intptr_t key) |
Get the object according to the specified integer key. More... | |
const __String * | valueForKey (const std::string &key) |
Get the value according to the specified string key. More... | |
local | valueForKey ( local key) |
Get the value according to the specified string key. More... | |
const __String * | valueForKey (intptr_t key) |
Get the value according to the specified integer key. More... | |
local | valueForKey ( local key) |
Get the value according to the specified integer key. More... | |
void | setObject (Ref *pObject, const std::string &key) |
Insert an object to dictionary, and match it with the specified string key. More... | |
void | setObject (Ref *pObject, intptr_t key) |
Insert an object to dictionary, and match it with the specified string key. More... | |
local | setObject ( local pObject, local key) |
Insert an object to dictionary, and match it with the specified string key. More... | |
void | removeObjectForKey (const std::string &key) |
Remove an object by the specified string key. More... | |
void | removeObjectForKey (intptr_t key) |
Remove an object by the specified integer key. More... | |
void | removeObjectsForKeys (__Array *pKey__Array) |
Remove objects by an array of keys. More... | |
void | removeObjectForElememt (DictElement *pElement) |
Remove an object by an element. More... | |
void | removeAllObjects () |
Remove all objects in the dictionary. More... | |
Ref * | randomObject () |
Return a random object in the dictionary. More... | |
bool | writeToFile (const char *fullPath) |
Write a dictionary to a plist file. More... | |
virtual void | acceptVisitor (DataVisitor &visitor) |
virtual __Dictionary * | clone () const |
returns a copy of the Ref More... | |
Public Member Functions inherited from Ref | |
void | retain () |
Retains the ownership. More... | |
void | release () |
Release the ownership immediately. More... | |
Ref * | autorelease () |
Release the ownership sometime soon automatically. More... | |
unsigned int | getReferenceCount () const |
Returns the Ref's current reference count. More... | |
virtual | ~Ref () |
Public Member Functions inherited from Clonable | |
virtual | ~Clonable () |
Ref * | copy () const |
returns a copy of the Ref. More... | |
var | copy () |
returns a copy of the Ref. More... | |
local | copy () |
returns a copy of the Ref. More... | |
Static Public Member Functions | |
static __Dictionary * | create () |
Create a dictionary. More... | |
static __Dictionary * | createWithDictionary (__Dictionary *srcDict) |
Create a dictionary with an existing dictionary. More... | |
static __Dictionary * | createWithContentsOfFile (const char *pFileName) |
Create a dictionary with a plist file. More... | |
static __Dictionary * | createWithContentsOfFileThreadSafe (const char *pFileName) |
Create a dictionary with a plist file. More... | |
Public Attributes | |
DictElement * | _elements |
All the elements in dictionary. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from Ref | |
Ref () | |
Constructor. More... | |
Protected Attributes inherited from Ref | |
unsigned int | _referenceCount |
count of references More... | |
Dictionary is a class like NSDictionary in Obj-C .
__Dictionary | ( | ) |
The constructor of Dictionary.
~__Dictionary | ( | ) |
The destructor of Dictionary.
|
virtual |
|
virtual |
|
virtual |
__Array* allKeys | ( | ) |
Return all keys of elements.
local allKeys | ( | ) |
Return all keys of elements.
Get all keys according to the specified object.
local allKeysForObject | ( | local | object) |
Get all keys according to the specified object.
|
virtual |
unsigned int count | ( | ) |
Get the count of elements in Dictionary.
local count | ( | ) |
Get the count of elements in Dictionary.
|
static |
Create a dictionary.
|
static |
Create a dictionary.
|
static |
Create a dictionary with a plist file.
pFileName | The name of the plist file. |
|
static |
Create a dictionary with a plist file.
pFileName | The name of the plist file. |
|
static |
Create a dictionary with a plist file.
pFileName | The name of the plist file. |
|
static |
Create a dictionary with an existing dictionary.
srcDict | The exist dictionary. |
|
static |
Create a dictionary with an existing dictionary.
srcDict | The exist dictionary. |
bool init | ( | ) |
Initializes the dictionary.
It returns true if the initializations was successful.
Ref* objectForKey | ( | const std::string & | key) |
Get the object according to the specified string key.
key | The string key for searching. |
local objectForKey | ( | local | key) |
Get the object according to the specified string key.
key | The string key for searching. |
Get the object according to the specified integer key.
key | The integer key for searching. |
local objectForKey | ( | local | key) |
Get the object according to the specified integer key.
key | The integer key for searching. |
Ref* randomObject | ( | ) |
Return a random object in the dictionary.
void removeAllObjects | ( | ) |
Remove all objects in the dictionary.
local removeAllObjects | ( | ) |
Remove all objects in the dictionary.
void removeObjectForElememt | ( | DictElement * | pElement) |
Remove an object by an element.
pElement | The element need to be removed. |
void removeObjectForKey | ( | const std::string & | key) |
Remove an object by the specified string key.
key | The string key for searching. |
local removeObjectForKey | ( | local | key) |
Remove an object by the specified string key.
key | The string key for searching. |
void removeObjectForKey | ( | intptr_t | key) |
Remove an object by the specified integer key.
key | The integer key for searching. |
local removeObjectForKey | ( | local | key) |
Remove an object by the specified integer key.
key | The integer key for searching. |
void removeObjectsForKeys | ( | __Array * | pKey__Array) |
Remove objects by an array of keys.
pKeyArray | The array contains keys to be removed. |
local removeObjectsForKeys | ( | local | pKey__Array) |
Remove objects by an array of keys.
pKeyArray | The array contains keys to be removed. |
void setObject | ( | Ref * | pObject, |
const std::string & | key | ||
) |
Insert an object to dictionary, and match it with the specified string key.
pObject | The Object to be inserted. |
key | The string key for searching. |
local setObject | ( | local | pObject, |
local | key | ||
) |
Insert an object to dictionary, and match it with the specified string key.
pObject | The Object to be inserted. |
key | The string key for searching. |
Insert an object to dictionary, and match it with the specified string key.
pObject | The Object to be inserted. |
key | The string key for searching. |
local setObject | ( | local | pObject, |
local | key | ||
) |
Insert an object to dictionary, and match it with the specified string key.
pObject | The Object to be inserted. |
key | The string key for searching. |
const __String* valueForKey | ( | const std::string & | key) |
Get the value according to the specified string key.
key | The string key for searching |
local valueForKey | ( | local | key) |
Get the value according to the specified string key.
key | The string key for searching |
Get the value according to the specified integer key.
key | The string key for searching. |
local valueForKey | ( | local | key) |
Get the value according to the specified integer key.
key | The string key for searching. |
bool writeToFile | ( | const char * | fullPath) |
Write a dictionary to a plist file.
fullPath | The full path of the plist file. You can get writeable path by getWritablePath() |
DictElement* _elements |
All the elements in dictionary.
var _elements |
All the elements in dictionary.
local _elements |
All the elements in dictionary.