#include <sbuild-parse-error.h>
Inheritance diagram for sbuild::parse_error:
Public Types | |
NONE | |
No error occured. Used for detail only. | |
BAD_FILE | |
The file to parse couldn't be opened. | |
BAD_VALUE | |
The value could not be parsed. | |
INVALID_LINE | |
The line is invalid. | |
NO_GROUP | |
No group was specified. | |
INVALID_GROUP | |
The group is invalid. | |
DUPLICATE_GROUP | |
The group is a duplicate. | |
NO_KEY | |
No key was specified. | |
DUPLICATE_KEY | |
The key is a duplicate. | |
MISSING_KEY | |
The key is missing. | |
DISALLOWED_KEY | |
The key is not allowed. | |
enum | type { NONE, BAD_FILE, BAD_VALUE, INVALID_LINE, NO_GROUP, INVALID_GROUP, DUPLICATE_GROUP, NO_KEY, DUPLICATE_KEY, MISSING_KEY, DISALLOWED_KEY } |
Public Member Functions | |
parse_error (type error, std::string const &detail) | |
The constructor. | |
parse_error (size_t line, type error, std::string const &detail) | |
The constructor. | |
parse_error (size_t line, std::string const &group, type error, std::string const &detail) | |
The constructor. | |
parse_error (size_t line, std::string const &group, std::string const &key, type error, std::string const &detail) | |
The constructor. | |
parse_error (std::string const &group, type error, std::string const &detail) | |
The constructor. | |
parse_error (std::string const &group, std::string const &key, type error, std::string const &detail) | |
The constructor. | |
Static Private Member Functions | |
static const char * | get_error (type error) |
Get a translated error string. | |
static std::string | format_error (type error, std::string const &detail) |
Format an error message. | |
static std::string | format_error (size_t line, type error, std::string const &detail) |
Format an error message. | |
static std::string | format_error (size_t line, std::string const &group, type error, std::string const &detail) |
Format an error message. | |
static std::string | format_error (size_t line, std::string const &group, std::string const &key, type error, std::string const &detail) |
Format an error message. | |
static std::string | format_error (std::string const &group, type error, std::string const &detail) |
Format an error message. | |
static std::string | format_error (std::string const &group, std::string const &key, type error, std::string const &detail) |
Format an error message. | |
Static Private Attributes | |
static std::map< type, const char * > | error_strings |
Mapping between error code and string. |
sbuild::parse_error::parse_error | ( | type | error, | |
std::string const & | detail | |||
) |
The constructor.
error | the error code. | |
detail | the details of the error. |
sbuild::parse_error::parse_error | ( | size_t | line, | |
type | error, | |||
std::string const & | detail | |||
) |
The constructor.
line | the line the error occured on. | |
error | the error code. | |
detail | the details of the error. |
sbuild::parse_error::parse_error | ( | size_t | line, | |
std::string const & | group, | |||
type | error, | |||
std::string const & | detail | |||
) |
The constructor.
line | the line the error occured on. | |
group | the group the error occured within. | |
error | the error code. | |
detail | the details of the error. |
sbuild::parse_error::parse_error | ( | size_t | line, | |
std::string const & | group, | |||
std::string const & | key, | |||
type | error, | |||
std::string const & | detail | |||
) |
The constructor.
line | the line the error occured on. | |
group | the group the error occured within. | |
key | the key the error occured within. | |
error | the error code. | |
detail | the details of the error. |
sbuild::parse_error::parse_error | ( | std::string const & | group, | |
type | error, | |||
std::string const & | detail | |||
) |
The constructor.
group | the group the error occured within. | |
error | the error code. | |
detail | the details of the error. |
sbuild::parse_error::parse_error | ( | std::string const & | group, | |
std::string const & | key, | |||
type | error, | |||
std::string const & | detail | |||
) |
The constructor.
group | the group the error occured within. | |
key | the key the error occured within. | |
error | the error code. | |
detail | the details of the error. |
static std::string sbuild::parse_error::format_error | ( | std::string const & | group, | |
std::string const & | key, | |||
type | error, | |||
std::string const & | detail | |||
) | [static, private] |
Format an error message.
group | the group the error occured within. | |
key | the key the error occured within. | |
error | the error code. | |
detail | the details of the error. |
static std::string sbuild::parse_error::format_error | ( | std::string const & | group, | |
type | error, | |||
std::string const & | detail | |||
) | [static, private] |
Format an error message.
group | the group the error occured within. | |
error | the error code. | |
detail | the details of the error. |
static std::string sbuild::parse_error::format_error | ( | size_t | line, | |
std::string const & | group, | |||
std::string const & | key, | |||
type | error, | |||
std::string const & | detail | |||
) | [static, private] |
Format an error message.
line | the line the error occured on. | |
group | the group the error occured within. | |
key | the key the error occured within. | |
error | the error code. | |
detail | the details of the error. |
static std::string sbuild::parse_error::format_error | ( | size_t | line, | |
std::string const & | group, | |||
type | error, | |||
std::string const & | detail | |||
) | [static, private] |
Format an error message.
line | the line the error occured on. | |
group | the group the error occured within. | |
error | the error code. | |
detail | the details of the error. |
static std::string sbuild::parse_error::format_error | ( | size_t | line, | |
type | error, | |||
std::string const & | detail | |||
) | [static, private] |
Format an error message.
line | the line the error occured on. | |
error | the error code. | |
detail | the details of the error. |
static std::string sbuild::parse_error::format_error | ( | type | error, | |
std::string const & | detail | |||
) | [static, private] |
Format an error message.
error | the error code. | |
detail | the details of the error. |
static const char* sbuild::parse_error::get_error | ( | type | error | ) | [static, private] |
Get a translated error string.
error | the error code. |
std::map< parse_error::type, const char * > parse_error::error_strings [static, private] |
Mapping between error code and string.