rpcs3/document.cpp
Jesse Beder bcbca461de Beginning of first attempt to parse.
Will be completely wiped, I think, in favor of a Scanner (to tokens), then Parser mechanism.
2008-06-26 06:49:50 +00:00

39 lines
560 B
C++

#include "document.h"
#include "node.h"
#include "parser.h"
#include <fstream>
namespace YAML
{
Document::Document(): m_pRoot(0)
{
}
Document::Document(const std::string& fileName): m_pRoot(0)
{
Load(fileName);
}
Document::~Document()
{
Clear();
}
void Document::Clear()
{
delete m_pRoot;
m_pRoot = 0;
}
void Document::Load(const std::string& fileName)
{
Clear();
std::ifstream fin(fileName.c_str());
Parser parser(fin);
if(!parser)
return;
m_pRoot = parser.ReadNextNode();
}
}