[ox/oc] Cleanup
This commit is contained in:
parent
af7dbd1aee
commit
ed598378ae
6
deps/ox/src/ox/oc/read.hpp
vendored
6
deps/ox/src/ox/oc/read.hpp
vendored
@ -63,7 +63,7 @@ class OrganicClawReader {
|
||||
Error field(const char *key, UnionView<U> val);
|
||||
|
||||
template<std::size_t L>
|
||||
Error field(const char *key, ox::BString<L> *val);
|
||||
Error field(const char *key, BString<L> *val);
|
||||
|
||||
Error field(const char *key, SerStr val);
|
||||
|
||||
@ -141,7 +141,7 @@ Error OrganicClawReader::field(const char *key, UnionView<U> val) {
|
||||
}
|
||||
|
||||
template<std::size_t L>
|
||||
Error OrganicClawReader::field(const char *name, ox::BString<L> *val) {
|
||||
Error OrganicClawReader::field(const char *name, BString<L> *val) {
|
||||
return field(name, SerStr(val->data(), val->cap()));
|
||||
}
|
||||
|
||||
@ -196,7 +196,7 @@ template<typename T>
|
||||
Result<T> readOC(const char *json, std::size_t jsonLen) {
|
||||
T val;
|
||||
oxReturnError(readOC(json, jsonLen, &val));
|
||||
return ox::move(val);
|
||||
return move(val);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
|
2
deps/ox/src/ox/oc/write.cpp
vendored
2
deps/ox/src/ox/oc/write.cpp
vendored
@ -91,7 +91,7 @@ Error OrganicClawWriter::field(const char *key, bool *val) {
|
||||
return OxError(0);
|
||||
}
|
||||
|
||||
Error OrganicClawWriter::field(const char *key, ox::String val) {
|
||||
Error OrganicClawWriter::field(const char *key, String val) {
|
||||
if (targetValid() && val.len()) {
|
||||
value(key) = val.c_str();
|
||||
}
|
||||
|
10
deps/ox/src/ox/oc/write.hpp
vendored
10
deps/ox/src/ox/oc/write.hpp
vendored
@ -55,9 +55,9 @@ class OrganicClawWriter {
|
||||
Error field(const char*, HashMap<String, T> *val);
|
||||
|
||||
template<std::size_t L>
|
||||
Error field(const char*, ox::BString<L> *val);
|
||||
Error field(const char*, BString<L> *val);
|
||||
|
||||
Error field(const char*, ox::String val);
|
||||
Error field(const char*, String val);
|
||||
|
||||
Error field(const char*, SerStr val);
|
||||
|
||||
@ -97,7 +97,7 @@ Error OrganicClawWriter::field(const char *key, T *val, std::size_t len) {
|
||||
}
|
||||
|
||||
template<std::size_t L>
|
||||
Error OrganicClawWriter::field(const char *key, ox::BString<L> *val) {
|
||||
Error OrganicClawWriter::field(const char *key, BString<L> *val) {
|
||||
return field(key, SerStr(val->data(), val->cap()));
|
||||
}
|
||||
|
||||
@ -130,12 +130,12 @@ Error OrganicClawWriter::field(const char *key, UnionView<U> val) {
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
Error OrganicClawWriter::field(const char *key, ox::HashMap<String, T> *val) {
|
||||
Error OrganicClawWriter::field(const char *key, HashMap<String, T> *val) {
|
||||
if (targetValid()) {
|
||||
const auto &keys = val->keys();
|
||||
OrganicClawWriter w;
|
||||
for (std::size_t i = 0; i < keys.size(); ++i) {
|
||||
auto k = keys[i].c_str();
|
||||
const auto k = keys[i].c_str();
|
||||
oxReturnError(w.field(k, &val->operator[](k)));
|
||||
}
|
||||
value(key) = w.m_json;
|
||||
|
Loading…
Reference in New Issue
Block a user