mirror of
https://github.com/jbeder/yaml-cpp.git
synced 2025-09-09 12:41:17 +00:00
Added operator >> overload for Binary
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user