Added operator >> overload for Binary

This commit is contained in:
Jesse Beder
2012-01-21 02:01:37 -06:00
parent d760d037ca
commit 01eb370300
3 changed files with 46 additions and 0 deletions

View File

@@ -1,4 +1,5 @@
#include "yaml-cpp/binary.h"
#include "yaml-cpp/node.h"
namespace YAML
{
@@ -90,4 +91,12 @@ namespace YAML
ret.resize(out - &ret[0]);
return ret;
}
void operator >> (const Node& node, Binary& binary)
{
std::string scalar;
node.GetScalar(scalar);
std::vector<unsigned char> data = DecodeBase64(scalar);
binary.swap(data);
}
}