diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2020-01-21 19:41:33 +0000 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2020-01-21 19:41:33 +0000 |
commit | e7c1a4fc8c55795f707e83ce6d5607e0b41f5099 (patch) | |
tree | 4c862cd6dadd3b8abf75c5431e07175d68391eec /storageapi | |
parent | 28e18ba48168b6ea3ca09164c647c96fe261a74a (diff) |
Add stream method and use memcpy over casting.
Diffstat (limited to 'storageapi')
4 files changed, 9 insertions, 2 deletions
diff --git a/storageapi/src/vespa/storageapi/message/visitor.cpp b/storageapi/src/vespa/storageapi/message/visitor.cpp index f398b4c8146..e531e73fea5 100644 --- a/storageapi/src/vespa/storageapi/message/visitor.cpp +++ b/storageapi/src/vespa/storageapi/message/visitor.cpp @@ -181,7 +181,7 @@ VisitorInfoCommand::print(std::ostream& out, bool verbose, const std::string& in out << "VisitorInfoCommand("; if (_completed) { out << "completed"; } if (_error.failed()) { - out << _error.toString(); + out << _error; } if (verbose) { out << ") : "; diff --git a/storageapi/src/vespa/storageapi/messageapi/returncode.cpp b/storageapi/src/vespa/storageapi/messageapi/returncode.cpp index 634a7166d74..1868e53e4a5 100644 --- a/storageapi/src/vespa/storageapi/messageapi/returncode.cpp +++ b/storageapi/src/vespa/storageapi/messageapi/returncode.cpp @@ -36,6 +36,11 @@ ReturnCode::toString() const { return ret; } +std::ostream & +operator << (std::ostream & os, const ReturnCode & returnCode) { + return os << returnCode.toString(); +} + bool ReturnCode::isBusy() const { diff --git a/storageapi/src/vespa/storageapi/messageapi/returncode.h b/storageapi/src/vespa/storageapi/messageapi/returncode.h index 58392e545a9..305a998918c 100644 --- a/storageapi/src/vespa/storageapi/messageapi/returncode.h +++ b/storageapi/src/vespa/storageapi/messageapi/returncode.h @@ -105,4 +105,6 @@ public: vespalib::string toString() const; }; +std::ostream & operator << (std::ostream & os, const ReturnCode & returnCode); + } diff --git a/storageapi/src/vespa/storageapi/messageapi/storagereply.cpp b/storageapi/src/vespa/storageapi/messageapi/storagereply.cpp index 1033b016629..81cdadb3623 100644 --- a/storageapi/src/vespa/storageapi/messageapi/storagereply.cpp +++ b/storageapi/src/vespa/storageapi/messageapi/storagereply.cpp @@ -25,7 +25,7 @@ StorageReply::print(std::ostream& out, bool verbose, const std::string& indent) const { (void) verbose; (void) indent; - out << "StorageReply(" << _type.getName() << ", " << _result.toString() << ")"; + out << "StorageReply(" << _type.getName() << ", " << _result << ")"; } } |