Start of moving Value -> Node and Node -> old API Node (with a #define toggle)

This commit is contained in:
Jesse Beder
2011-09-10 17:18:15 -05:00
parent 78b7a1b8a9
commit ac81d7c883
40 changed files with 0 additions and 0 deletions

29
src/node/parse.cpp Normal file
View File

@@ -0,0 +1,29 @@
#include "yaml-cpp/value/parse.h"
#include "yaml-cpp/value/value.h"
#include "yaml-cpp/value/impl.h"
#include "yaml-cpp/parser.h"
#include "valuebuilder.h"
#include <sstream>
namespace YAML
{
Value Parse(const std::string& input) {
std::stringstream stream(input);
return Parse(stream);
}
Value Parse(const char *input) {
std::stringstream stream(input);
return Parse(stream);
}
Value Parse(std::istream& input) {
Parser parser(input);
ValueBuilder builder;
if(!parser.HandleNextDocument(builder))
return Value();
return builder.Root();
}
}