7 #ifndef PACKAGER_STATUS_H_
8 #define PACKAGER_STATUS_H_
13 #if defined(SHARED_LIBRARY_BUILD)
16 #if defined(SHAKA_IMPLEMENTATION)
17 #define SHAKA_EXPORT __declspec(dllexport)
19 #define SHAKA_EXPORT __declspec(dllimport)
20 #endif // defined(SHAKA_IMPLEMENTATION)
22 #else // defined(_WIN32)
24 #if defined(SHAKA_IMPLEMENTATION)
25 #define SHAKA_EXPORT __attribute__((visibility("default")))
30 #endif // defined(_WIN32)
32 #else // defined(SHARED_LIBRARY_BUILD)
34 #endif // defined(SHARED_LIBRARY_BUILD)
118 Status(error::Code error_code,
const std::string& error_message);
123 static const Status UNKNOWN;
134 void Update(
Status new_status);
136 bool ok()
const {
return error_code_ == error::OK; }
137 error::Code error_code()
const {
return error_code_; }
138 const std::string& error_message()
const {
return error_message_; }
140 bool operator==(
const Status& x)
const {
141 return error_code_ == x.error_code() && error_message_ == x.error_message();
143 bool operator!=(
const Status& x)
const {
return !(*
this == x); }
146 std::string ToString()
const;
149 error::Code error_code_;
150 std::string error_message_;
156 SHAKA_EXPORT std::ostream& operator<<(std::ostream& os,
const Status& x);
160 #endif // PACKAGER_STATUS_H_