summaryrefslogtreecommitdiffstats
path: root/yaml-cpp/src/iterator.cpp
diff options
context:
space:
mode:
authorimarom <imarom@cisco.com>2015-08-24 17:52:52 +0300
committerimarom <imarom@cisco.com>2015-08-24 17:52:52 +0300
commit36c6c87fe4380b214f8ff8a45dc0213fa109821c (patch)
treeac4886a9e36fef3d0d7f621ac46678ebb7486015 /yaml-cpp/src/iterator.cpp
parent7d3be8c612e295820649779335288c197b80ccb2 (diff)
fix compile issues with external libarries
Diffstat (limited to 'yaml-cpp/src/iterator.cpp')
-rwxr-xr-xyaml-cpp/src/iterator.cpp103
1 files changed, 0 insertions, 103 deletions
diff --git a/yaml-cpp/src/iterator.cpp b/yaml-cpp/src/iterator.cpp
deleted file mode 100755
index f4159e32..00000000
--- a/yaml-cpp/src/iterator.cpp
+++ /dev/null
@@ -1,103 +0,0 @@
-#include "yaml-cpp/node.h"
-#include "yaml-cpp/exceptions.h"
-#include "iterpriv.h"
-
-namespace YAML
-{
- Iterator::Iterator(): m_pData(new IterPriv)
- {
- }
-
- Iterator::Iterator(std::auto_ptr<IterPriv> pData): m_pData(pData)
- {
- }
-
- Iterator::Iterator(const Iterator& rhs): m_pData(new IterPriv(*rhs.m_pData))
- {
- }
-
- Iterator& Iterator::operator = (const Iterator& rhs)
- {
- if(this == &rhs)
- return *this;
-
- m_pData.reset(new IterPriv(*rhs.m_pData));
- return *this;
- }
-
- Iterator::~Iterator()
- {
- }
-
- Iterator& Iterator::operator ++ ()
- {
- if(m_pData->type == IterPriv::IT_SEQ)
- ++m_pData->seqIter;
- else if(m_pData->type == IterPriv::IT_MAP)
- ++m_pData->mapIter;
-
- return *this;
- }
-
- Iterator Iterator::operator ++ (int)
- {
- Iterator temp = *this;
-
- if(m_pData->type == IterPriv::IT_SEQ)
- ++m_pData->seqIter;
- else if(m_pData->type == IterPriv::IT_MAP)
- ++m_pData->mapIter;
-
- return temp;
- }
-
- const Node& Iterator::operator * () const
- {
- if(m_pData->type == IterPriv::IT_SEQ)
- return **m_pData->seqIter;
-
- throw BadDereference();
- }
-
- const Node *Iterator::operator -> () const
- {
- if(m_pData->type == IterPriv::IT_SEQ)
- return *m_pData->seqIter;
-
- throw BadDereference();
- }
-
- const Node& Iterator::first() const
- {
- if(m_pData->type == IterPriv::IT_MAP)
- return *m_pData->mapIter->first;
-
- throw BadDereference();
- }
-
- const Node& Iterator::second() const
- {
- if(m_pData->type == IterPriv::IT_MAP)
- return *m_pData->mapIter->second;
-
- throw BadDereference();
- }
-
- bool operator == (const Iterator& it, const Iterator& jt)
- {
- if(it.m_pData->type != jt.m_pData->type)
- return false;
-
- if(it.m_pData->type == IterPriv::IT_SEQ)
- return it.m_pData->seqIter == jt.m_pData->seqIter;
- else if(it.m_pData->type == IterPriv::IT_MAP)
- return it.m_pData->mapIter == jt.m_pData->mapIter;
-
- return true;
- }
-
- bool operator != (const Iterator& it, const Iterator& jt)
- {
- return !(it == jt);
- }
-}