NCBI C++ ToolKit
Public Types | Public Member Functions | Protected Attributes | List of all members
CJsonIterator Class Reference

Search Toolkit Book for CJsonIterator

Iterator for JSON arrays and objects. More...

#include <connect/services/json_over_uttp.hpp>

+ Collaboration diagram for CJsonIterator:

Public Types

typedef SJsonIteratorImplTInstance
 

Public Member Functions

 CJsonIterator (EVoid)
 
 CJsonIterator (SJsonIteratorImpl *impl)
 
CJsonIteratoroperator= (SJsonIteratorImpl *impl)
 
 operator SJsonIteratorImpl * ()
 
 operator const SJsonIteratorImpl * () const
 
SJsonIteratorImploperator-- (int)
 
const SJsonIteratorImploperator-- (int) const
 
SJsonIteratorImploperator-> ()
 
const SJsonIteratorImploperator-> () const
 
 CJsonIterator ()
 
CJsonNode GetNode () const
 Return the value of the current element. More...
 
string GetKey () const
 When iterating over a JSON object, return the key of the current element. More...
 
bool Next ()
 Skip to the next element if there is one, in which case TRUE is returned. More...
 
bool IsValid () const
 Return true if this iterator is still valid. More...
 
CJsonNode operator* () const
 An alternative way to get the value of the current element. More...
 
CJsonIteratoroperator++ ()
 An operator version of Next(). More...
 
 operator bool () const
 An operator version of IsValid(). More...
 
 operator bool ()
 An operator version of IsValid(). More...
 

Protected Attributes

CNetRef< SJsonIteratorImplm_Impl
 

Detailed Description

Iterator for JSON arrays and objects.

See also
CJsonNode::Iterate()

Definition at line 336 of file json_over_uttp.hpp.

Member Typedef Documentation

◆ TInstance

Definition at line 338 of file json_over_uttp.hpp.

Constructor & Destructor Documentation

◆ CJsonIterator() [1/3]

CJsonIterator::CJsonIterator ( EVoid  )
inline

Definition at line 338 of file json_over_uttp.hpp.

◆ CJsonIterator() [2/3]

CJsonIterator::CJsonIterator ( SJsonIteratorImpl impl)
inline

Definition at line 338 of file json_over_uttp.hpp.

◆ CJsonIterator() [3/3]

CJsonIterator::CJsonIterator ( )
inline

Definition at line 338 of file json_over_uttp.hpp.

Member Function Documentation

◆ GetKey()

string CJsonIterator::GetKey ( void  ) const
inline

When iterating over a JSON object, return the key of the current element.

Definition at line 448 of file json_over_uttp.hpp.

References m_Impl.

Referenced by CJsonOverUTTPWriter::CompleteMessage(), SFlattenIterator::SFrame::MakePath(), and s_Repr_Object().

◆ GetNode()

CJsonNode CJsonIterator::GetNode ( void  ) const
inline

Return the value of the current element.

Definition at line 443 of file json_over_uttp.hpp.

References m_Impl.

Referenced by SFlattenIterator::GetNode(), operator*(), and SFlattenIterator::x_DepthFirstSearchForScalar().

◆ IsValid()

bool CJsonIterator::IsValid ( ) const
inline

Return true if this iterator is still valid.

Definition at line 458 of file json_over_uttp.hpp.

References m_Impl.

Referenced by SFlattenIterator::IsValid(), SFlattenIterator::Next(), and SFlattenIterator::x_DepthFirstSearchForScalar().

◆ Next()

bool CJsonIterator::Next ( )
inline

Skip to the next element if there is one, in which case TRUE is returned.

Otherwise, return FALSE.

Definition at line 453 of file json_over_uttp.hpp.

References m_Impl.

Referenced by SFlattenIterator::SFrame::Advance(), and CJsonOverUTTPWriter::CompleteMessage().

◆ operator bool() [1/2]

CJsonIterator::operator bool ( )
inline

An operator version of IsValid().

Definition at line 479 of file json_over_uttp.hpp.

◆ operator bool() [2/2]

CJsonIterator::operator bool ( ) const
inline

An operator version of IsValid().

Definition at line 474 of file json_over_uttp.hpp.

◆ operator const SJsonIteratorImpl *()

CJsonIterator::operator const SJsonIteratorImpl * ( ) const
inline

Definition at line 338 of file json_over_uttp.hpp.

◆ operator SJsonIteratorImpl *()

CJsonIterator::operator SJsonIteratorImpl * ( )
inline

Definition at line 338 of file json_over_uttp.hpp.

◆ operator*()

CJsonNode CJsonIterator::operator* ( void  ) const
inline

An alternative way to get the value of the current element.

Definition at line 463 of file json_over_uttp.hpp.

References GetNode().

◆ operator++()

CJsonIterator & CJsonIterator::operator++ ( void  )
inline

An operator version of Next().

Definition at line 468 of file json_over_uttp.hpp.

References m_Impl.

◆ operator--() [1/2]

SJsonIteratorImpl& CJsonIterator::operator-- ( int  )
inline

Definition at line 338 of file json_over_uttp.hpp.

◆ operator--() [2/2]

const SJsonIteratorImpl& CJsonIterator::operator-- ( int  ) const
inline

Definition at line 338 of file json_over_uttp.hpp.

◆ operator->() [1/2]

SJsonIteratorImpl* CJsonIterator::operator-> ( void  )
inline

Definition at line 338 of file json_over_uttp.hpp.

◆ operator->() [2/2]

const SJsonIteratorImpl* CJsonIterator::operator-> ( void  ) const
inline

Definition at line 338 of file json_over_uttp.hpp.

◆ operator=()

CJsonIterator& CJsonIterator::operator= ( SJsonIteratorImpl impl)
inline

Definition at line 338 of file json_over_uttp.hpp.

Member Data Documentation

◆ m_Impl

CNetRef< SJsonIteratorImpl > CJsonIterator::m_Impl
protected

Definition at line 338 of file json_over_uttp.hpp.

Referenced by GetKey(), GetNode(), IsValid(), Next(), and operator++().


The documentation for this class was generated from the following file:
Modified on Sun Apr 21 03:43:35 2024 by modify_doxy.py rev. 669887