dmlite 0.6
status.h
Go to the documentation of this file.
1/// @file include/dmlite/cpp/status.h
2/// @brief Status objects used by the API
3/// @author Georgios Bitzes <georgios.bitzes@cern.ch>
4#ifndef DMLITE_CPP_STATUS_H
5#define DMLITE_CPP_STATUS_H
6
7#include "dmlite/common/config.h"
9#include "exceptions.h"
10
11#include <cstdarg>
12#include <exception>
13#include <string>
14
15namespace dmlite {
16
17class DmStatus {
18public:
21 DmStatus(int code, const std::string &string);
22 DmStatus(int code, const char* fmt, va_list args);
23 DmStatus(int code, const char* fmt, ...);
24
25 DmStatus(const DmStatus &de);
27
28 virtual ~DmStatus() throw();
29
30 int code() const throw();
31 const char* what() const throw();
32
33 bool ok() const throw();
34 DmException exception() const throw();
35
36protected:
38 std::string errorMsg_;
39
40 void setMessage(const char* fmt, va_list args);
41};
42
43};
44#endif // DMLITE_CPP_STATUS_H
Base exception class.
Definition exceptions.h:17
Definition status.h:17
DmException exception() const
std::string errorMsg_
Definition status.h:38
virtual ~DmStatus()
int errorCode_
Definition status.h:37
DmStatus(int code)
void setMessage(const char *fmt, va_list args)
const char * what() const
DmStatus(const DmStatus &de)
bool ok() const
DmStatus(const DmException &de)
DmStatus(int code, const std::string &string)
int code() const
DmStatus(int code, const char *fmt,...)
DmStatus(int code, const char *fmt, va_list args)
Error codes.
Exceptions used by the API.
Namespace for the dmlite C++ API.
Definition authn.h:16