WARNING: USE THIS SOFTWARE AT YOUR OWN RISK! THIS IS EXPERIMENTAL SOFTWARE NOT INTENDED FOR PRODUCTION USE! Zuble is currently an early stage prototype. As such Zuble is minimally tested and inherently unstable. It is provided for experimental, development, and demonstration purposes only. Zuble QML Types   |  Zuble C++ Classes   |  Zuble Overview
Zuble  0.1
Zuble Framework C++/QML extension API
Public Slots | Public Member Functions | Static Public Member Functions | Protected Attributes | Properties | Private Types | List of all members
Zbl::ZMap Class Reference

A Javascript dictionary object. More...

#include <ZMap.h>

Inheritance diagram for Zbl::ZMap:
Inheritance graph
[legend]
Collaboration diagram for Zbl::ZMap:
Collaboration graph
[legend]

Public Slots

void set (const QString &key, QJSValue value)
 Sets the specified key in the map to the specified value. More...
 
bool remove (const QString &key)
 Removes the specified key from the map. More...
 
void clear ()
 Remove all key/value pairs from the map. More...
 

Public Member Functions

 ZMap (QObject *parent=0)
 
int getSize ()
 
Q_INVOKABLE bool has (const QString &key)
 Returns true if the map contains the specified key. More...
 
Q_INVOKABLE QJSValue get (const QString &key)
 Returns the value associated with a specified key in the map. More...
 
Q_INVOKABLE QVariantList keys ()
 Obtain the key names in the map. More...
 

Static Public Member Functions

static void registerType ()
 Register ZMailbox as a QML type. More...
 

Protected Attributes

zMap m_map
 

Properties

int size
 The number of items in the map. More...
 

Private Types

typedef QMap< QString, QJSValue > zMap
 

Detailed Description

A Javascript dictionary object.

Definition at line 40 of file ZMap.h.

Member Typedef Documentation

◆ zMap

typedef QMap<QString, QJSValue> Zbl::ZMap::zMap
private

Definition at line 44 of file ZMap.h.

Constructor & Destructor Documentation

◆ ZMap()

Zbl::ZMap::ZMap ( QObject *  parent = 0)
explicit

Definition at line 31 of file ZMap.cpp.

Member Function Documentation

◆ clear

void Zbl::ZMap::clear ( )
slot

Remove all key/value pairs from the map.

Definition at line 87 of file ZMap.cpp.

◆ get()

QJSValue Zbl::ZMap::get ( const QString &  key)

Returns the value associated with a specified key in the map.

Parameters
keyKey for which a value will be obtained
Returns
The value stored for the specified key

Definition at line 51 of file ZMap.cpp.

◆ getSize()

int Zbl::ZMap::getSize ( )

Definition at line 41 of file ZMap.cpp.

◆ has()

bool Zbl::ZMap::has ( const QString &  key)

Returns true if the map contains the specified key.

Parameters
keyThe key to test
Returns
true if map contains key, false otherwise

Definition at line 46 of file ZMap.cpp.

◆ keys()

QVariantList Zbl::ZMap::keys ( )

Obtain the key names in the map.

Returns
An array containing the name of keys in the map

Definition at line 66 of file ZMap.cpp.

◆ registerType()

void Zbl::ZMap::registerType ( )
static

Register ZMailbox as a QML type.

Definition at line 36 of file ZMap.cpp.

Referenced by Zbl::Zblcore::registerTypes().

◆ remove

bool Zbl::ZMap::remove ( const QString &  key)
slot

Removes the specified key from the map.

Parameters
keyThe key that will be removed.
Returns
true if the key was removed from the map, false if the key didn't exist in the map

Definition at line 61 of file ZMap.cpp.

◆ set

void Zbl::ZMap::set ( const QString &  key,
QJSValue  value 
)
slot

Sets the specified key in the map to the specified value.

Any previous value for the specified key will be overwritten with the new value.

Parameters
keyThe key for which a value will be set
valueThe value to set in the map.

Definition at line 56 of file ZMap.cpp.

Member Data Documentation

◆ m_map

zMap Zbl::ZMap::m_map
protected

Definition at line 125 of file ZMap.h.

Referenced by clear(), get(), getSize(), has(), keys(), remove(), and set().

Property Documentation

◆ size

int Zbl::ZMap::size
read

The number of items in the map.

Definition at line 59 of file ZMap.h.


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