Small changes in the iterator code.

Changed the public interface of Scanner to resemble an STL container.
This commit is contained in:
beder
2008-07-23 04:38:18 +00:00
parent 57255a9898
commit 89ed418b83
14 changed files with 108 additions and 112 deletions

View File

@@ -56,7 +56,7 @@ namespace YAML
return temp;
}
const Node& Iterator::operator * ()
const Node& Iterator::operator * () const
{
if(m_pData->type == IterPriv::IT_SEQ)
return **m_pData->seqIter;
@@ -64,15 +64,15 @@ namespace YAML
throw BadDereference();
}
const Node *Iterator::operator -> ()
const Node *Iterator::operator -> () const
{
if(m_pData->type == IterPriv::IT_SEQ)
return &**m_pData->seqIter;
return *m_pData->seqIter;
throw BadDereference();
}
const Node& Iterator::first()
const Node& Iterator::first() const
{
if(m_pData->type == IterPriv::IT_MAP)
return *m_pData->mapIter->first;
@@ -80,7 +80,7 @@ namespace YAML
throw BadDereference();
}
const Node& Iterator::second()
const Node& Iterator::second() const
{
if(m_pData->type == IterPriv::IT_MAP)
return *m_pData->mapIter->second;