2008-09-04 02:20:39 +04:00
|
|
|
#include "yaml.h"
|
|
|
|
#include "tests.h"
|
|
|
|
#include <fstream>
|
|
|
|
#include <iostream>
|
2009-01-27 23:16:30 +03:00
|
|
|
#include <cstring>
|
2008-09-04 02:20:39 +04:00
|
|
|
|
|
|
|
void run()
|
|
|
|
{
|
|
|
|
std::ifstream fin("tests/test.yaml");
|
2009-02-01 23:48:43 +03:00
|
|
|
YAML::Parser parser(fin);
|
2008-09-04 02:20:39 +04:00
|
|
|
|
2009-02-01 23:48:43 +03:00
|
|
|
while(parser)
|
|
|
|
{
|
2008-09-25 04:15:40 +04:00
|
|
|
YAML::Node doc;
|
|
|
|
parser.GetNextDocument(doc);
|
2009-02-01 23:48:43 +03:00
|
|
|
std::cout << doc;
|
2008-09-04 02:20:39 +04:00
|
|
|
}
|
2009-05-23 01:52:31 +04:00
|
|
|
|
|
|
|
// try some output
|
|
|
|
YAML::Emitter out;
|
2008-09-04 02:20:39 +04:00
|
|
|
}
|
|
|
|
|
|
|
|
int main(int argc, char **argv)
|
|
|
|
{
|
|
|
|
bool verbose = false;
|
|
|
|
for(int i=1;i<argc;i++) {
|
2009-01-27 23:16:30 +03:00
|
|
|
if(std::strcmp(argv[i], "-v") == 0)
|
2008-09-04 02:20:39 +04:00
|
|
|
verbose = true;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef WINDOWS
|
|
|
|
_CrtSetDbgFlag(_CRTDBG_LEAK_CHECK_DF|_CRTDBG_ALLOC_MEM_DF);
|
|
|
|
#endif // WINDOWS
|
|
|
|
Test::RunAll(verbose);
|
|
|
|
run();
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|