mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 20:51:16 +00:00
Added a (recursive) ordering, so we have a canonical output that we can compare.
This commit is contained in:
14
content.h
14
content.h
@@ -5,12 +5,16 @@
|
||||
#include <map>
|
||||
#include "parserstate.h"
|
||||
#include "exceptions.h"
|
||||
#include "ltnode.h"
|
||||
|
||||
namespace YAML
|
||||
{
|
||||
class Scanner;
|
||||
class Parser;
|
||||
class Node;
|
||||
class Scalar;
|
||||
class Sequence;
|
||||
class Map;
|
||||
|
||||
class Content
|
||||
{
|
||||
@@ -22,9 +26,9 @@ namespace YAML
|
||||
virtual void Write(std::ostream& out, int indent, bool startedLine, bool onlyOneCharOnLine) = 0;
|
||||
|
||||
virtual bool GetBegin(std::vector <Node *>::const_iterator& it) const { return false; }
|
||||
virtual bool GetBegin(std::map <Node *, Node *>::const_iterator& it) const { return false; }
|
||||
virtual bool GetBegin(std::map <Node *, Node *, ltnode>::const_iterator& it) const { return false; }
|
||||
virtual bool GetEnd(std::vector <Node *>::const_iterator& it) const { return false; }
|
||||
virtual bool GetEnd(std::map <Node *, Node *>::const_iterator& it) const { return false; }
|
||||
virtual bool GetEnd(std::map <Node *, Node *, ltnode>::const_iterator& it) const { return false; }
|
||||
virtual Node *GetNode(unsigned i) const { return 0; }
|
||||
virtual unsigned GetSize() const { return 0; }
|
||||
|
||||
@@ -37,6 +41,12 @@ namespace YAML
|
||||
virtual void Read(double& d) { throw InvalidScalar(); }
|
||||
virtual void Read(char& c) { throw InvalidScalar(); }
|
||||
|
||||
// ordering
|
||||
virtual int Compare(Content *pContent) { return 0; }
|
||||
virtual int Compare(Scalar *pScalar) { return 0; }
|
||||
virtual int Compare(Sequence *pSeq) { return 0; }
|
||||
virtual int Compare(Map *pMap) { return 0; }
|
||||
|
||||
protected:
|
||||
};
|
||||
}
|
||||
|
Reference in New Issue
Block a user