2008-07-20 05:02:01 +00:00
|
|
|
#include "yaml.h"
|
2008-07-05 19:00:58 +00:00
|
|
|
#include "tests.h"
|
2008-06-30 06:51:22 +00:00
|
|
|
#include <fstream>
|
2008-06-30 23:57:58 +00:00
|
|
|
#include <iostream>
|
2008-06-25 22:45:08 +00:00
|
|
|
|
2008-07-14 05:08:46 +00:00
|
|
|
#ifdef _DEBUG
|
|
|
|
|
#pragma comment(lib, "yamlcppd.lib")
|
|
|
|
|
#else
|
|
|
|
|
#pragma comment(lib, "yamlcpp.lib")
|
|
|
|
|
#endif
|
|
|
|
|
|
2008-07-20 05:02:01 +00:00
|
|
|
void run()
|
2008-07-02 05:00:32 +00:00
|
|
|
{
|
2008-07-20 05:02:01 +00:00
|
|
|
std::ifstream fin("yaml-reader/tests/test.yaml");
|
2008-07-02 05:00:32 +00:00
|
|
|
|
2008-07-20 05:02:01 +00:00
|
|
|
try {
|
|
|
|
|
YAML::Parser parser(fin);
|
|
|
|
|
if(!parser)
|
|
|
|
|
return;
|
2008-07-02 05:00:32 +00:00
|
|
|
|
2008-07-20 05:02:01 +00:00
|
|
|
YAML::Node doc;
|
|
|
|
|
parser.GetNextDocument(doc);
|
|
|
|
|
std::cout << doc;
|
|
|
|
|
} catch(YAML::Exception&) {
|
|
|
|
|
std::cout << "Error parsing the yaml!\n";
|
2008-07-02 05:00:32 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2008-06-25 22:45:08 +00:00
|
|
|
int main()
|
2008-07-20 05:02:01 +00:00
|
|
|
{
|
|
|
|
|
_CrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF|_CRTDBG_ALLOC_MEM_DF);
|
|
|
|
|
Test::RunAll();
|
|
|
|
|
run();
|
2008-07-02 01:22:39 +00:00
|
|
|
|
2008-06-30 23:57:58 +00:00
|
|
|
getchar();
|
2008-06-25 22:45:08 +00:00
|
|
|
return 0;
|
2008-07-05 19:00:58 +00:00
|
|
|
}
|