#include "kp_bool.h"
#include "kp_errors_define_decl.txt"
Go to the source code of this file.
Defines | |
#define | ERROR_UNKNOWN_TEXT "Unknown error." |
Text for unknown error. | |
#define | KP_ERROR_DECLARATION(enum_code_decl, code_value, error_text) enum_code_decl code_value, |
#define | KP_ERROR_DECLARATION_LAST(enum_code_decl, code_value, error_text) enum_code_decl code_value |
Enumerations | |
enum | kp_errors |
Enum with error codes. More... | |
Functions | |
KP_ERROR_DECLARATION (ERROR_INCORRECT_PROPERTY_VALUE,,"Incorrect property value(incorrect value type).") KP_ERROR_DECLARATION(ERROR_INCORRECT_PROPLIST | |
Property list has incorrect | data (properties)." ) |
int | set_error (int error_code) |
Sets code of error. | |
int | get_error_code () |
Return code of error. | |
int | get_error_code_and_reset () |
Return code of error and reset error. | |
const char * | get_error_text () |
Return error message. | |
char * | get_error_text_and_reset () |
Return error message and reset error. | |
const char * | get_error_text_by_code (int error_code) |
Gets error message by error code. | |
int | reset_error () |
Sets code of error equals 0 (no errors) and message equals empty string. |
#define ERROR_UNKNOWN_TEXT "Unknown error." |
Text for unknown error.
#define KP_ERROR_DECLARATION | ( | enum_code_decl, | |||
code_value, | |||||
error_text | ) | enum_code_decl code_value, |
#define KP_ERROR_DECLARATION_LAST | ( | enum_code_decl, | |||
code_value, | |||||
error_text | ) | enum_code_decl code_value |
enum kp_errors |
Enum with error codes.
Property list has incorrect kp_errors::data | ( | properties | ) |
int get_error_code | ( | ) |
Return code of error.
int get_error_code_and_reset | ( | ) |
Return code of error and reset error.
const char* get_error_text | ( | ) |
Return error message.
char* get_error_text_and_reset | ( | ) |
Return error message and reset error.
Return error message and reset error. You need free message text after using.
const char* get_error_text_by_code | ( | int | error_code | ) |
Gets error message by error code.
error_code | code of error. |
kp_errors::KP_ERROR_DECLARATION | ( | ERROR_INCORRECT_PROPERTY_VALUE | , | |
"Incorrect property value(incorrect value type)." | ||||
) |
int reset_error | ( | ) |
Sets code of error equals 0 (no errors) and message equals empty string.
int set_error | ( | int | error_code | ) |
Sets code of error.
error_code | code of error. |