Bayeux  3.4.1
Core Foundation library for SuperNEMO
Namespaces | Enumerations | Functions
utils.h File Reference
#include <cstdlib>
#include <list>
#include <string>
#include <datatools/exception.h>
#include <datatools/bit_mask.h>

Go to the source code of this file.

Namespaces

 datatools
 The Bayeux/datatools library top-level namespace.
 

Enumerations

enum  datatools::return_code_type { datatools::SUCCESS = EXIT_SUCCESS, datatools::ERROR = EXIT_FAILURE, datatools::FAILURE = EXIT_FAILURE }
 Return codes. More...
 
enum  datatools::compare_result_type { datatools::COMPARE_UNDEFINED = -2, datatools::COMPARE_LESS = -1, datatools::COMPARE_EQUAL = 0, datatools::COMPARE_GREATER = 1 }
 Comparison result code for comparable objects. More...
 
enum  datatools::name_validation_flags {
  datatools::NV_NO_COLON = bit_mask::bit00, datatools::NV_NO_DOT = bit_mask::bit01, datatools::NV_NO_HYPHEN = bit_mask::bit02, datatools::NV_NO_UNDERSCORE = bit_mask::bit03,
  datatools::NV_LEADING_DIGIT = bit_mask::bit04, datatools::NV_DEFAULT = NV_NO_HYPHEN, datatools::NV_INSTANCE = NV_NO_HYPHEN | NV_NO_COLON, datatools::NV_MODEL = NV_NO_HYPHEN
}
 

Functions

const std::string & datatools::empty_string ()
 
const std::string & datatools::none_label ()
 
const std::string & datatools::yes_label ()
 
const std::string & datatools::no_label ()
 
void datatools::invalidate (float &value_)
 
float datatools::invalid_real_single ()
 Return invalid single precision float (set at NaN): More...
 
bool datatools::is_valid (float value_)
 
bool datatools::is_infinity (float value_)
 
bool datatools::is_plus_infinity (float value_)
 
bool datatools::is_minus_infinity (float value_)
 
void datatools::plus_infinity (float &value_)
 
void datatools::minus_infinity (float &value_)
 
void datatools::infinity (float &value_)
 
void datatools::invalidate (double &value_)
 
double datatools::invalid_real_double ()
 Return invalid double precision real (set at NaN): More...
 
double datatools::invalid_real ()
 Return invalid double precision real (set at NaN): More...
 
bool datatools::is_valid (double value_)
 
bool datatools::is_infinity (double value_)
 
bool datatools::is_plus_infinity (double value_)
 
bool datatools::is_minus_infinity (double value_)
 
bool datatools::is_normal (double value_)
 
void datatools::plus_infinity (double &value_)
 
void datatools::minus_infinity (double &value_)
 
void datatools::infinity (double &value_)
 
compare_result_type datatools::compare_real (double x1_, double x2_, double abs_eps_=0.0, double rel_eps_=0.0)
 
bool datatools::name_validation (const std::string &name_, uint32_t flags_=NV_DEFAULT)
 Check if a name (object identifier) is valid using simple criteria. More...
 
bool datatools::is_quoted (const std::string &text_, char q_='"')
 
void datatools::add_quotes (const std::string &from_, std::string &to_, char q_='"')
 Add quotes to a string. More...
 
void datatools::add_quotes (std::string &text_, char q_='"')
 Add quotes to a string. More...
 
void datatools::remove_quotes (const std::string &from_, std::string &to_, char q_='"')
 Remove quotes from a string. More...
 
void datatools::remove_quotes (std::string &text_, char q_='"')
 Remove quotes from a string. More...
 
void datatools::remove_all_quotes (std::string &text_)
 Remove all quotes from a string. More...
 
bool datatools::resolve_library_info_path_keys (const std::string &library_topic_, std::string &install_path_key_, std::string &environ_path_key_)
 Extract the keys used by library information registration mechanism. More...
 
std::string datatools::fetch_path (const std::string &path_str_)
 
bool datatools::fetch_path (std::string &word_, std::string &errmsg_)
 Extract the expanded path computed from the 'word' string. More...
 
bool datatools::fetch_path_with_env (std::string &word_)
 
bool datatools::fetch_path_with_env (std::string &word_, std::string &errmsg_)
 Extract the expanded path computed from the 'word' string. More...
 
bool datatools::fetch_path_without_env (std::string &word_)
 
bool datatools::fetch_path_with_env_p (std::string &word_, const std::string &parent_path_)
 
bool datatools::fetch_path_with_env_g (std::string &word_)
 
bool datatools::fetch_path_with_env_pg (std::string &word_, const std::string &parent_path_)
 
bool datatools::has_global_path ()
 
void datatools::reset_global_path ()
 
void datatools::set_global_path (const std::string &gpath_)
 
const std::string & datatools::get_global_path ()
 
std::string datatools::expand_path (const std::string &path_str_)
 
void datatools::split_string (const std::string &word_, const std::string &separators_, std::list< std::string > &words_)
 
template<typename Integral >
void datatools::set_bit (Integral &number_, int pos_)
 
template<typename Integral >
void datatools::unset_bit (Integral &number_, int pos_)
 
template<typename Integral >
void datatools::toggle_bit (Integral &number_, int pos_)
 
template<typename Integral >
bool datatools::check_bit (Integral &number_, int pos_)