1 #pragma clang diagnostic push
2 #pragma ide diagnostic ignored "google-explicit-constructor"
3 #pragma ide diagnostic ignored "modernize-use-equals-default"
4 #ifndef FILESEQ_ERROR_H_
5 #define FILESEQ_ERROR_H_
13 #define DEPRECATED(func) func __attribute__ ((deprecated))
14 #elif defined(_MSC_VER)
15 #define DEPRECATED(func) __declspec(deprecated) func
17 #pragma message("WARNING: You need to implement DEPRECATED for this compiler")
18 #define DEPRECATED(func) func
37 operator bool()
const {
return m_error.empty(); }
40 operator std::string()
const {
return m_error; }
44 Status& operator=(
const Status& rhs) {
45 m_error = rhs.m_error;
49 void clearError() { m_error.clear(); }
50 void setError(
const std::string &err) { m_error = err; }
51 void setError(
const char* err) { m_error = err; }
53 friend std::ostream& operator<< (std::ostream& stream,
const Status& stat) {
54 stream << (std::string)stat;
66 void handleErrorStatus(
const std::string &msg, Status* stat=
nullptr);
68 void setError(
const std::string &msg, Status* stat);
78 #pragma clang diagnostic pop