NvDialog 0.10.1
A cross-platform modal dialogs library for C/C++ that uses the native OS theme.
Loading...
Searching...
No Matches
nvdialog_error.h File Reference
#include "nvdialog_string.h"
#include "nvdialog_platform.h"

Go to the source code of this file.

Macros

#define __nvdialog_error_h__   1

Enumerations

enum  NvdError {
  NVD_NO_ERROR = 0 , NVD_NO_DISPLAY , NVD_BACKEND_FAILURE ,
  NVD_INVALID_PARAM , NVD_NOT_INITIALIZED , NVD_BACKEND_INVALID ,
  NVD_FILE_INACCESSIBLE , NVD_STRING_EMPTY , NVD_OUT_OF_MEMORY ,
  NVD_INTERNAL_ERROR , NVD_ALREADY_INITIALIZED , NVD_UNSUPPORTED_ACTION
}
 An enumerator describing possible errors that may occur from the library. One of its fields is returned by nvd_get_error depending on whether a (and what) problem might've occured after an operation. More...

Functions

NVD_API NvdError nvd_get_error (void)
 Returns the current error code of the library.
NVD_API NvdDynamicStringnvd_stringify_error (NvdError err)
 Transforms an error code into a string representation, that can be used to print errors to the console.

Macro Definition Documentation

◆ __nvdialog_error_h__

#define __nvdialog_error_h__   1

Enumeration Type Documentation

◆ NvdError

enum NvdError

An enumerator describing possible errors that may occur from the library. One of its fields is returned by nvd_get_error depending on whether a (and what) problem might've occured after an operation.

See also
nvd_stringify_error
Since
v0.1.0
Enumerator
NVD_NO_ERROR 
NVD_NO_DISPLAY 
NVD_BACKEND_FAILURE 
NVD_INVALID_PARAM 
NVD_NOT_INITIALIZED 
NVD_BACKEND_INVALID 
NVD_FILE_INACCESSIBLE 
NVD_STRING_EMPTY 
NVD_OUT_OF_MEMORY 
NVD_INTERNAL_ERROR 
NVD_ALREADY_INITIALIZED 
NVD_UNSUPPORTED_ACTION 

Function Documentation

◆ nvd_get_error()

NVD_API NvdError nvd_get_error ( void )

Returns the current error code of the library.

The error code has to be manually be transformed into a string using nvd_stringify_error. Else, use the NvdError enum to check for the error manually.

Returns
The error code (Will be automatically 0 if no errors were encountered).

◆ nvd_stringify_error()

NVD_API NvdDynamicString * nvd_stringify_error ( NvdError err)

Transforms an error code into a string representation, that can be used to print errors to the console.

Returns
A NvdDynamicString containing the error as a string, or NULL in case of failure or invalid parameter.
Note
Pre v0.10 code may not work with this function due to different return types.