[ox] Rename ValErr to Result

This commit is contained in:
2020-10-16 19:43:10 -05:00
parent faadcae7e9
commit 6b720042d0
23 changed files with 68 additions and 68 deletions

View File

@@ -208,7 +208,7 @@ Error OrganicClawReader::field(const char *key, SerStr val) {
return err;
}
ValErr<std::size_t> OrganicClawReader::arrayLength(const char *key, bool) {
Result<std::size_t> OrganicClawReader::arrayLength(const char *key, bool) {
const auto &jv = value(key);
if (jv.empty()) {
return 0;

View File

@@ -72,7 +72,7 @@ class OrganicClawReader {
* Reads an array length from the current location in the buffer.
* @param pass indicates that the parsing should iterate past the array length
*/
ValErr<std::size_t> arrayLength(const char *key, bool pass = true);
Result<std::size_t> arrayLength(const char *key, bool pass = true);
/**
* Reads an string length from the current location in the buffer.
@@ -195,7 +195,7 @@ Error readOC(const char *json, std::size_t jsonSize, T *val) noexcept {
}
template<typename T>
ValErr<std::unique_ptr<T>> readOC(const char *json) {
Result<std::unique_ptr<T>> readOC(const char *json) {
auto val = std::make_unique<T>();
oxReturnError(readOC(json, ox_strlen(json), val.get()));
return {std::move(val), OxError(0)};

View File

@@ -21,7 +21,7 @@ namespace ox {
class OrganicClawWriter {
template<typename T>
friend ValErr<Vector<char>> writeOC(T *val);
friend Result<Vector<char>> writeOC(T *val);
protected:
Json::Value m_json;
@@ -149,7 +149,7 @@ Error OrganicClawWriter::field(const char *key, ox::HashMap<String, T> *val) {
}
template<typename T>
ValErr<Vector<char>> writeOC(T *val) {
Result<Vector<char>> writeOC(T *val) {
OrganicClawWriter writer;
oxReturnError(model(&writer, val));
Json::StreamWriterBuilder jsonBuilder;