libjmmcg  build_2783
A C++ library containing an eclectic mix of useful, advanced components.
jmmcg::exit_codes Class Reference

A nice enum for the exit codes from main(). More...

#include <exit_codes.hpp>

Public Types

enum  codes : std::uint8_t {
  exit_success =EXIT_SUCCESS, exit_unknown_failure =EXIT_FAILURE, exit_unknown_exception =129, exit_stl_exception,
  exit_jmmcg_exception, exit_crt_exception, exit_parameter_error, exit_print_help,
  exit_print_version
}
 

Static Public Member Functions

static std::string to_string (codes e) noexcept(false)
 
static std::string to_string () noexcept(false)
 

Detailed Description

A nice enum for the exit codes from main().

Note use of POSIX compatibility macros & starting our custom errors at 129. Also note that we shouldn't exceed 255, as the exit code is truncated to 8 bits, which would cause problems...

Definition at line 56 of file exit_codes.hpp.

Member Enumeration Documentation

◆ codes

enum jmmcg::exit_codes::codes : std::uint8_t
Enumerator
exit_success 
exit_unknown_failure 
exit_unknown_exception 
exit_stl_exception 
exit_jmmcg_exception 
exit_crt_exception 
exit_parameter_error 
exit_print_help 
exit_print_version 

Definition at line 75 of file exit_codes.hpp.

Member Function Documentation

◆ to_string() [1/2]

std::string jmmcg::exit_codes::to_string ( )
inlinestaticnoexcept

Definition at line 82 of file exit_codes_impl.hpp.

◆ to_string() [2/2]

std::string jmmcg::exit_codes::to_string ( codes  e)
inlinestaticnoexcept

Definition at line 77 of file exit_codes_impl.hpp.


The documentation for this class was generated from the following files: