Merged utf branch changes r178:187 into the trunk

This commit is contained in:
jbeder
2009-07-10 03:10:03 +00:00
parent aa959e6705
commit e7f1ca7fb1
13 changed files with 939 additions and 271 deletions

2
util/CMakeLists.txt Normal file
View File

@@ -0,0 +1,2 @@
add_executable(parse parse.cpp)
target_link_libraries(parse yaml-cpp)

21
util/parse.cpp Normal file
View File

@@ -0,0 +1,21 @@
#include "yaml.h"
#include <fstream>
#include <iostream>
int main(int argc, char **argv)
{
if(argc != 2) {
std::cout << "Usage: " << argv[0] << " input-file\n";
return 0;
}
std::ifstream fin(argv[1]);
try {
YAML::Parser parser(fin);
YAML::Node doc;
parser.GetNextDocument(doc);
} catch(const YAML::Exception& e) {
std::cerr << "Error at line " << e.line << ", col " << e.column << ": " << e.msg << "\n";
}
return 0;
}