Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
hdi::core::ai::Dictionary::Iterator Class Reference

Allows for iteration through the members of a dictionary, a la std::vector iteration. More...

#include <hdicoreaiDictionary.h>

Public Member Functions

 Iterator (const Iterator &iter_)
 Constructs an Iterator object from an existing Iterator object (copy constructor)
 
 ~Iterator ()
 Destructs an Iterator object.
 
Iteratoroperator= (const Iterator &rhs_)
 Assigns one Iterator object to another.
 
bool operator== (const Iterator &rhs_) const
 Tests whether a given Iterator object is the same as another.
 
bool operator!= (const Iterator &rhs_) const
 Tests whether a given Iterator object is not the same as another.
 
Iteratoroperator++ ()
 Prefix increment operator for forward iteration.
 
Iterator operator++ (int)
 Postfix increment operator for forward iteration.
 
Iteratoroperator-- ()
 Prefix decrement operator for reverse iteration.
 
Iterator operator-- (int)
 Postfix decrement operator for reverse iteration.
 
bool atEnd () const
 Determines whether iteration should stop; works well as the conditional in a for() loop.
 
std::string key () const
 Gets the key for the current entry pointed to by the iterator (or "" if at the end)
 
std::unique_ptr< Entryvalue () const
 Gets the current entry pointed to by the iterator.
 

Friends

class Dictionary
 

Detailed Description

Allows for iteration through the members of a dictionary, a la std::vector iteration.

// For example:
for(hdi::core::ai::Dictionary::Iterator iter = someDict.begin(); !iter.atEnd(); ++iter)
{
// Do stuff with either iter.key() or iter.value()
}
Allows for iteration through the members of a dictionary, a la std::vector iteration.
Definition: hdicoreaiDictionary.h:50
bool atEnd() const
Determines whether iteration should stop; works well as the conditional in a for() loop.

Constructor & Destructor Documentation

◆ Iterator()

hdi::core::ai::Dictionary::Iterator::Iterator ( const Iterator iter_)

Constructs an Iterator object from an existing Iterator object (copy constructor)

Author
GW
Date
10/2013
Parameters
iter_Existing Iterator object

◆ ~Iterator()

hdi::core::ai::Dictionary::Iterator::~Iterator ( )

Destructs an Iterator object.

Author
GW
Date
08/2013

Member Function Documentation

◆ atEnd()

bool hdi::core::ai::Dictionary::Iterator::atEnd ( ) const

Determines whether iteration should stop; works well as the conditional in a for() loop.

Author
GW
Date
08/2013
Returns
true if at the end of the list of members, false otherwise

◆ key()

std::string hdi::core::ai::Dictionary::Iterator::key ( ) const

Gets the key for the current entry pointed to by the iterator (or "" if at the end)

Author
GW
Date
08/2013
Returns
The current key as UTF-8, or "" if at the end

◆ operator!=()

bool hdi::core::ai::Dictionary::Iterator::operator!= ( const Iterator rhs_) const

Tests whether a given Iterator object is not the same as another.

Author
GW
Date
10/2013
Parameters
rhs_Iterator to compare against (righthand side of inequality operator)
Returns
true for the target and rhs_ having differing states, false otherwise

◆ operator++() [1/2]

Iterator & hdi::core::ai::Dictionary::Iterator::operator++ ( )

Prefix increment operator for forward iteration.

Author
GW
Date
08/2013
Returns
A reference to the iterator after its position was changed

◆ operator++() [2/2]

Iterator hdi::core::ai::Dictionary::Iterator::operator++ ( int  )

Postfix increment operator for forward iteration.

Author
GW
Date
08/2013
Returns
A copy of the original iterator before its position was changed

◆ operator--() [1/2]

Iterator & hdi::core::ai::Dictionary::Iterator::operator-- ( )

Prefix decrement operator for reverse iteration.

Author
GW
Date
08/2013
Returns
A reference to the iterator after its position was changed

◆ operator--() [2/2]

Iterator hdi::core::ai::Dictionary::Iterator::operator-- ( int  )

Postfix decrement operator for reverse iteration.

Author
GW
Date
08/2013
Returns
A copy of the original iterator before its position was changed

◆ operator=()

Iterator & hdi::core::ai::Dictionary::Iterator::operator= ( const Iterator rhs_)

Assigns one Iterator object to another.

Author
GW
Date
10/2013
Parameters
rhs_Existing Iterator object to copy values from
Returns
The target Iterator object, but with its values updated to match that of the rhs_ argument

◆ operator==()

bool hdi::core::ai::Dictionary::Iterator::operator== ( const Iterator rhs_) const

Tests whether a given Iterator object is the same as another.

Author
GW
Date
10/2013
Parameters
rhs_Iterator to compare against (righthand side of equality operator)
Returns
true for the target and rhs_ having the same state, false otherwise

◆ value()

std::unique_ptr< Entry > hdi::core::ai::Dictionary::Iterator::value ( ) const

Gets the current entry pointed to by the iterator.

Author
GW
Date
08/2013
Returns
The current entry, or NULL if at the end