mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-04 05:51:27 +12:00
This commit is contained in:
parent
bb55b0ba91
commit
110a7f06a8
6 changed files with 93 additions and 0 deletions
29
document.cpp
Normal file
29
document.cpp
Normal file
|
@ -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)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
22
document.h
Normal file
22
document.h
Normal file
|
@ -0,0 +1,22 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
}
|
8
main.cpp
Normal file
8
main.cpp
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
#include "document.h"
|
||||||
|
|
||||||
|
int main()
|
||||||
|
{
|
||||||
|
YAML::Document doc("test.yaml");
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
12
node.cpp
Normal file
12
node.cpp
Normal file
|
@ -0,0 +1,12 @@
|
||||||
|
#include "node.h"
|
||||||
|
|
||||||
|
namespace YAML
|
||||||
|
{
|
||||||
|
Node::Node()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
Node::~Node()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
}
|
20
node.h
Normal file
20
node.h
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
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;
|
||||||
|
};
|
||||||
|
}
|
2
test.yaml
Normal file
2
test.yaml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
---
|
||||||
|
test
|
Loading…
Add table
Add a link
Reference in a new issue