2014-07-31 00:35:19 +00:00
|
|
|
// Copyright 2004-present Facebook. All Rights Reserved.
|
|
|
|
|
2014-08-05 23:13:55 +00:00
|
|
|
#ifndef OSQUERY_STATUS_H
|
|
|
|
#define OSQUERY_STATUS_H
|
2014-07-31 00:35:19 +00:00
|
|
|
|
|
|
|
#include <string>
|
|
|
|
|
2014-08-05 23:13:55 +00:00
|
|
|
namespace osquery {
|
2014-07-31 00:35:19 +00:00
|
|
|
|
|
|
|
class Status {
|
|
|
|
public:
|
|
|
|
Status(int c, std::string m) : code_(c), message_(m) {}
|
|
|
|
public:
|
|
|
|
int getCode() { return code_; }
|
|
|
|
std::string getMessage() { return message_; }
|
|
|
|
bool ok() { return getCode() == 0; }
|
|
|
|
std::string toString() { return getMessage(); }
|
|
|
|
private:
|
|
|
|
int code_;
|
|
|
|
std::string message_;
|
|
|
|
};
|
|
|
|
|
2014-08-05 23:13:55 +00:00
|
|
|
}
|
2014-07-31 00:35:19 +00:00
|
|
|
|
2014-08-05 23:13:55 +00:00
|
|
|
#endif /* OSQUERY_STATUS_H */
|