libjmmcg  release_579_6_g8cffd
A C++ library containing an eclectic mix of useful, advanced components.
jmmcg::LIBJMMCG_VER_NAMESPACE::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 =128+_NSIG , 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().

There is some conflicting advice regarding user-defined exit coeds and permissible values:

  1. - between 64-113..Also see sysexits.h implies values over 128 should be used.

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 43 of file exit_codes.hpp.

Member Enumeration Documentation

◆ codes

Enumerator
exit_success 
exit_unknown_failure 
exit_unknown_exception 

User-defined codes start from here according to "signum-generic.h".

exit_stl_exception 
exit_jmmcg_exception 
exit_crt_exception 
exit_parameter_error 
exit_print_help 
exit_print_version 

Definition at line 45 of file exit_codes.hpp.

Member Function Documentation

◆ to_string() [1/2]

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

◆ to_string() [2/2]

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

Definition at line 59 of file exit_codes_impl.hpp.


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