mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-06 23:11:25 +12:00
Added an iterator class that can iterate through both sequence and map nodes.
This commit is contained in:
parent
f7358701f2
commit
d56b54b34f
16 changed files with 393 additions and 105 deletions
18
content.h
18
content.h
|
@ -1,12 +1,16 @@
|
|||
#pragma once
|
||||
|
||||
#include <ios>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include "parserstate.h"
|
||||
#include "exceptions.h"
|
||||
|
||||
namespace YAML
|
||||
{
|
||||
class Scanner;
|
||||
class Parser;
|
||||
class Node;
|
||||
|
||||
class Content
|
||||
{
|
||||
|
@ -17,6 +21,20 @@ namespace YAML
|
|||
virtual void Parse(Scanner *pScanner, const ParserState& state) = 0;
|
||||
virtual void Write(std::ostream& out, int indent) = 0;
|
||||
|
||||
virtual bool GetBegin(std::vector <Node *>::const_iterator& it) { return false; }
|
||||
virtual bool GetBegin(std::map <Node *, Node *>::const_iterator& it) { return false; }
|
||||
virtual bool GetEnd(std::vector <Node *>::const_iterator& it) { return false; }
|
||||
virtual bool GetEnd(std::map <Node *, Node *>::const_iterator& it) { return false; }
|
||||
|
||||
// extraction
|
||||
virtual void Read(std::string& s) { throw InvalidScalar(); }
|
||||
virtual void Read(int& i) { throw InvalidScalar(); }
|
||||
virtual void Read(unsigned& u) { throw InvalidScalar(); }
|
||||
virtual void Read(long& l) { throw InvalidScalar(); }
|
||||
virtual void Read(float& f) { throw InvalidScalar(); }
|
||||
virtual void Read(double& d) { throw InvalidScalar(); }
|
||||
virtual void Read(char& c) { throw InvalidScalar(); }
|
||||
|
||||
protected:
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue