ParseExceptions module
Module contents
-
class ParseError : public std::runtime_error
Simple class to encapsulate IO parsing errors
Subclassed by tracktable::EmptyCoordinateError, tracktable::EmptyFieldError, tracktable::LexicalCastError
Public Functions
-
inline ParseError()
Instantiate an unspecified parse exception.
-
inline ParseError(std::string const &err)
Instantiate an parse exception for a give error string
- Parameters:
err – [in] String indicating the type of exception
-
inline ParseError(const char *err)
Instantiate an parse exception for a give error string
- Parameters:
err – [in] Char array indicating the type of exception
-
inline ParseError()
-
class EmptyCoordinateError : public tracktable::ParseError
Simple class to encapsulate empty coordinate parsing error
Public Functions
-
inline EmptyCoordinateError(std::size_t which_coordinate)
Instantiate a empty coordinate exception for a give error string
- Parameters:
which_coordinate – [in] Value indicating which coordinate was empty
Private Static Functions
-
static inline std::string format_empty_coordinate_message(std::size_t which_coordinate)
Format the output error string for the empty coordinate
- Parameters:
which_coordinate – [in] Which coordinate is empty
-
inline EmptyCoordinateError(std::size_t which_coordinate)
-
class EmptyFieldError : public tracktable::ParseError
Simple class to encapsulate empty field parsing error
Public Functions
-
inline EmptyFieldError(std::string const &field_name)
Instantiate a empty field exception for a give error string
- Parameters:
field_name – [in] String indicating which field was empty
Private Static Functions
-
static inline std::string format_empty_field_message(std::string const &field_name)
Format the output error string for the empty field
- Parameters:
which_coordinate – [in] Which coordinate is empty
-
inline EmptyFieldError(std::string const &field_name)
-
class LexicalCastError : public tracktable::ParseError
Simple class to encapsulate lexical cast error
Public Functions
-
inline LexicalCastError(std::string const &field_name, std::string const &string_value, std::string const &expected_type)
Instantiate a empty lexical cast exception for a give error string
- Parameters:
field_name – [in] Name of the field that was going to be ccoverted
string_value – [in] String that was going to be converted
expected_type – [in] Type that the string_value was going to be coverted to
Private Static Functions
-
static inline std::string format_convert_error_message(std::string const &field_name, std::string const &string_value, std::string const &expected_type)
Format the output error string for the lexical cast error
- Parameters:
field_name – [in] Name of the field that was going to be ccoverted
string_value – [in] String that was going to be converted
expected_type – [in] Type that the string_value was going to be coverted to
-
inline LexicalCastError(std::string const &field_name, std::string const &string_value, std::string const &expected_type)