summaryrefslogtreecommitdiff
path: root/src/codecs/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/codecs/include')
-rw-r--r--src/codecs/include/codec.hpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/codecs/include/codec.hpp b/src/codecs/include/codec.hpp
index 299b16e4..e8be8f0a 100644
--- a/src/codecs/include/codec.hpp
+++ b/src/codecs/include/codec.hpp
@@ -40,6 +40,18 @@ class ICodec {
kInternalError,
};
+ static auto ErrorString(Error err) -> std::string {
+ switch (err) {
+ case Error::kOutOfInput:
+ return "out of input";
+ case Error::kMalformedData:
+ return "malformed data";
+ case Error::kInternalError:
+ return "internal error";
+ }
+ return "uhh";
+ }
+
/*
* Alias for more readable return types. All codec methods, success or
* failure, should also return the number of bytes they consumed.