From 110a7f06a83a5f2928db2d0b4d7f6e9bf04549c6 Mon Sep 17 00:00:00 2001 From: Jesse Beder Date: Wed, 25 Jun 2008 22:45:08 +0000 Subject: [PATCH] --- document.cpp | 29 +++++++++++++++++++++++++++++ document.h | 22 ++++++++++++++++++++++ main.cpp | 8 ++++++++ node.cpp | 12 ++++++++++++ node.h | 20 ++++++++++++++++++++ test.yaml | 2 ++ 6 files changed, 93 insertions(+) create mode 100644 document.cpp create mode 100644 document.h create mode 100644 main.cpp create mode 100644 node.cpp create mode 100644 node.h create mode 100644 test.yaml diff --git a/document.cpp b/document.cpp new file mode 100644 index 0000000000..a9ff19afdb --- /dev/null +++ b/document.cpp @@ -0,0 +1,29 @@ +#include "document.h" +#include "node.h" + +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) + { + } +} diff --git a/document.h b/document.h new file mode 100644 index 0000000000..285bf94569 --- /dev/null +++ b/document.h @@ -0,0 +1,22 @@ +#pragma once + +#include + +namespace YAML +{ + class Node; + + class Document + { + public: + Document(); + Document(const std::string& fileName); + ~Document(); + + void Clear(); + void Load(const std::string& fileName); + + private: + Node *m_pRoot; + }; +} diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000000..f5f3fa89a4 --- /dev/null +++ b/main.cpp @@ -0,0 +1,8 @@ +#include "document.h" + +int main() +{ + YAML::Document doc("test.yaml"); + + return 0; +} \ No newline at end of file diff --git a/node.cpp b/node.cpp new file mode 100644 index 0000000000..22c1beb656 --- /dev/null +++ b/node.cpp @@ -0,0 +1,12 @@ +#include "node.h" + +namespace YAML +{ + Node::Node() + { + } + + Node::~Node() + { + } +} diff --git a/node.h b/node.h new file mode 100644 index 0000000000..dd4d362349 --- /dev/null +++ b/node.h @@ -0,0 +1,20 @@ +#pragma once + +#include + +namespace YAML +{ + const std::string Str = "!!str"; + const std::string Seq = "!!seq"; + const std::string Map = "!!map"; + + class Node + { + public: + Node(); + ~Node(); + + private: + std::string m_tag; + }; +} diff --git a/test.yaml b/test.yaml new file mode 100644 index 0000000000..dfd38a095f --- /dev/null +++ b/test.yaml @@ -0,0 +1,2 @@ +--- +test \ No newline at end of file