summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--modules/codec-json/c++/json.tmpl.hpp4
-rw-r--r--modules/codec/c++/base64.hpp4
2 files changed, 6 insertions, 2 deletions
diff --git a/modules/codec-json/c++/json.tmpl.hpp b/modules/codec-json/c++/json.tmpl.hpp
index e73e49d..70cc0d1 100644
--- a/modules/codec-json/c++/json.tmpl.hpp
+++ b/modules/codec-json/c++/json.tmpl.hpp
@@ -18,7 +18,7 @@ struct json_helper {
static error_or<void> print_pretty_indent(buffer& to, uint64_t depth){
{
- auto eov = to.push(*reinterpret_cast<const uint8_t*>("\r\n"), 2);
+ auto eov = to.push(*reinterpret_cast<const uint8_t*>("\n"));
if(!eov.template is_type<err::no_error>()){
return eov;
}
@@ -751,7 +751,7 @@ struct json_decode<schema::Struct<schema::Member<T,Lits>...>, ToDecode> {
// Check if there are no elements present in the JSON Struct
if(buff.read() == '}'){
if(sizeof...(T) > 0){
- return make_error<err::invalid_state>("Expected Struct ending '}'");
+ return make_error<err::invalid_state>("Expected non empty struct");
}
buff.read_advance(1);
return void_t{};
diff --git a/modules/codec/c++/base64.hpp b/modules/codec/c++/base64.hpp
index fcd2f75..b65060e 100644
--- a/modules/codec/c++/base64.hpp
+++ b/modules/codec/c++/base64.hpp
@@ -30,6 +30,10 @@ public:
return data_.at(i);
}
+ std::string stl_string() const {
+ return data_;
+ }
+
bool operator==(const data<Schema, encode::Base64>& rhs) const {
return data_ == rhs.data_;
}