yaml-cpp/document.cpp

45 lines
651 B
C++
Raw Normal View History

2008-06-26 02:45:08 +04:00
#include "document.h"
#include "node.h"
#include "parser.h"
2008-06-26 13:05:28 +04:00
#include "scanner.h"
#include "exceptions.h"
#include <fstream>
2008-06-26 02:45:08 +04:00
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());
2008-06-26 13:05:28 +04:00
Scanner scanner(fin);
2008-06-28 00:54:43 +04:00
scanner.Scan();
2008-06-27 02:00:39 +04:00
getchar();
2008-06-26 13:05:28 +04:00
// if(!scanner)
// return;
2008-06-26 13:05:28 +04:00
// m_pRoot = parser.ReadNextNode();
2008-06-26 02:45:08 +04:00
}
}