mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 20:51:16 +00:00
Finished parsing of basic data types (scalar, sequence, map).
This commit is contained in:
21
scalar.cpp
21
scalar.cpp
@@ -1,12 +1,31 @@
|
||||
#include "scalar.h"
|
||||
#include "scanner.h"
|
||||
#include "token.h"
|
||||
|
||||
namespace YAML
|
||||
{
|
||||
Scalar::Scalar(const std::string& data): m_data(data)
|
||||
Scalar::Scalar()
|
||||
{
|
||||
}
|
||||
|
||||
Scalar::~Scalar()
|
||||
{
|
||||
}
|
||||
|
||||
void Scalar::Parse(Scanner *pScanner)
|
||||
{
|
||||
Token *pToken = pScanner->GetNextToken();
|
||||
m_data = pToken->value;
|
||||
delete pToken;
|
||||
}
|
||||
|
||||
void Scalar::Write(std::ostream& out, int indent)
|
||||
{
|
||||
for(int i=0;i<indent;i++)
|
||||
out << " ";
|
||||
out << "{scalar}\n";
|
||||
for(int i=0;i<indent;i++)
|
||||
out << " ";
|
||||
out << m_data << std::endl;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user