Bayeux  3.4.1
Core Foundation library for SuperNEMO
Classes | Public Types | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
datatools::io Struct Reference

I/O utilities. More...

#include <bayeux/datatools/ioutils.h>

Classes

struct  constants
 
class  indenter
 I/O indenter class. More...
 

Public Types

enum  reader_flags {
  reader_no_flags = 0, reader_debug = bit_mask::bit00, reader_allow_trailing_characters = bit_mask::bit01, reader_case_sensitive = bit_mask::bit02,
  reader_strict_quoting = bit_mask::bit03
}
 
enum  writer_flags {
  writer_no_flags = 0, writer_debug = bit_mask::bit00, writer_underscore_sep = bit_mask::bit01, writer_tilda_sep = bit_mask::bit02,
  writer_strict_quoting = bit_mask::bit03
}
 

Public Member Functions

bool is_colored () const
 
void set_colored (bool)
 
 ~io ()
 Destructor. More...
 

Static Public Member Functions

static void convert_command_line_args (int argc_, char **argv_, std::string &app_name_, std::vector< std::string > &args_)
 
static bool read_boolean (std::istream &, bool &, uint32_t flags=0)
 Parse a boolean. More...
 
static bool read_boolean (const std::string &, bool &, uint32_t flags=0)
 Parse a boolean. More...
 
static void write_boolean (std::ostream &a_out, bool a_bool, bool as_alpha=false)
 Write a boolean. More...
 
static bool read_integer (std::istream &, int &, uint32_t flags=0)
 Parse an integer. More...
 
static bool read_integer (const std::string &, int &, uint32_t flags=0)
 Parse an integer. More...
 
static void write_integer (std::ostream &, int)
 Write an integer. More...
 
static bool read_quoted_string (std::istream &, std::string &, uint32_t flags=0)
 Parse a quoted string. More...
 
static bool read_quoted_string (const std::string &, std::string &, uint32_t flags=0)
 Parse an integer. More...
 
static void write_quoted_string (std::ostream &, const std::string &a_str)
 Write a quoted string. More...
 
static bool read_real_number (std::istream &in_, double &val, bool &normal, uint32_t flags=0)
 Read a double value from an ASCII stream. More...
 
static bool read_real_number (const std::string &, double &val, bool &normal, uint32_t flags=0)
 Read a double value from a string. More...
 
static void write_real_number (std::ostream &out_, double val_, int precision_=REAL_PRECISION, const std::string &unit_symbol_="", const std::string &unit_label_="", double unit_value_=1.0, uint32_t flags_=0)
 Write a double value in an ASCII stream with unit support. More...
 
static std::ostream & normal (std::ostream &)
 
static std::ostream & reverse (std::ostream &)
 
static std::ostream & bold (std::ostream &)
 
static std::ostream & underline (std::ostream &)
 
static std::ostream & red (std::ostream &)
 
static std::ostream & green (std::ostream &)
 
static std::ostream & debug (std::ostream &)
 
static std::ostream & devel (std::ostream &)
 
static std::ostream & notice (std::ostream &)
 
static std::ostream & warning (std::ostream &)
 
static std::ostream & error (std::ostream &)
 
static std::ostream & verbose (std::ostream &)
 
static std::ostream & tab (std::ostream &)
 
static std::ostream & vtab (std::ostream &)
 
static std::ostream & page_break (std::ostream &)
 
static std::ostream & left (std::ostream &)
 
static std::ostream & right (std::ostream &)
 
static std::ostream & internal (std::ostream &)
 
static std::ostream & showbase (std::ostream &)
 
static std::ostream & ostream_width (std::ostream &os, const int &n)
 
static ostream_manipulator< int > width (const int &n)
 
static std::ostream & ostream_precision (std::ostream &os, const int &n)
 
static ostream_manipulator< int > precision (const int &n)
 
static std::string to_binary (const uint32_t &val, bool show_all=false)
 
static std::string to_binary_2 (const uint32_t &val)
 
static indenterindent ()
 
static ioinstance ()
 

Static Public Attributes

static const int REAL_PRECISION = 16
 Default precision for double. More...
 
static const int REAL8_PRECISION = 16
 Default precision for double. More...
 
static const int REAL4_PRECISION = 8
 Default precision for float. More...
 

Protected Member Functions

 io ()
 Default constructor. More...
 

Detailed Description

I/O utilities.

Member Enumeration Documentation

◆ reader_flags

Enumerator
reader_no_flags 
reader_debug 
reader_allow_trailing_characters 
reader_case_sensitive 
reader_strict_quoting 

◆ writer_flags

Enumerator
writer_no_flags 
writer_debug 
writer_underscore_sep 
writer_tilda_sep 
writer_strict_quoting 

Constructor & Destructor Documentation

◆ io()

datatools::io::io ( )
protected

Default constructor.

◆ ~io()

datatools::io::~io ( )

Destructor.

Member Function Documentation

◆ bold()

static std::ostream& datatools::io::bold ( std::ostream &  )
static

◆ convert_command_line_args()

static void datatools::io::convert_command_line_args ( int  argc_,
char **  argv_,
std::string &  app_name_,
std::vector< std::string > &  args_ 
)
static
Deprecated:
Convert traditional main function arguments to a vector of strings

◆ debug()

static std::ostream& datatools::io::debug ( std::ostream &  )
static

◆ devel()

static std::ostream& datatools::io::devel ( std::ostream &  )
static

◆ error()

static std::ostream& datatools::io::error ( std::ostream &  )
static

◆ green()

static std::ostream& datatools::io::green ( std::ostream &  )
static

◆ indent()

static indenter& datatools::io::indent ( )
static

◆ instance()

static io& datatools::io::instance ( )
static

◆ internal()

static std::ostream& datatools::io::internal ( std::ostream &  )
static

◆ is_colored()

bool datatools::io::is_colored ( ) const

◆ left()

static std::ostream& datatools::io::left ( std::ostream &  )
static

◆ normal()

static std::ostream& datatools::io::normal ( std::ostream &  )
static

◆ notice()

static std::ostream& datatools::io::notice ( std::ostream &  )
static

◆ ostream_precision()

static std::ostream& datatools::io::ostream_precision ( std::ostream &  os,
const int &  n 
)
static

◆ ostream_width()

static std::ostream& datatools::io::ostream_width ( std::ostream &  os,
const int &  n 
)
static

◆ page_break()

static std::ostream& datatools::io::page_break ( std::ostream &  )
static

◆ precision()

static ostream_manipulator<int> datatools::io::precision ( const int &  n)
static

◆ read_boolean() [1/2]

static bool datatools::io::read_boolean ( std::istream &  ,
bool &  ,
uint32_t  flags = 0 
)
static

Parse a boolean.

◆ read_boolean() [2/2]

static bool datatools::io::read_boolean ( const std::string &  ,
bool &  ,
uint32_t  flags = 0 
)
static

Parse a boolean.

◆ read_integer() [1/2]

static bool datatools::io::read_integer ( std::istream &  ,
int &  ,
uint32_t  flags = 0 
)
static

Parse an integer.

◆ read_integer() [2/2]

static bool datatools::io::read_integer ( const std::string &  ,
int &  ,
uint32_t  flags = 0 
)
static

Parse an integer.

◆ read_quoted_string() [1/2]

static bool datatools::io::read_quoted_string ( std::istream &  ,
std::string &  ,
uint32_t  flags = 0 
)
static

Parse a quoted string.

◆ read_quoted_string() [2/2]

static bool datatools::io::read_quoted_string ( const std::string &  ,
std::string &  ,
uint32_t  flags = 0 
)
static

Parse an integer.

◆ read_real_number() [1/2]

static bool datatools::io::read_real_number ( std::istream &  in_,
double &  val,
bool &  normal,
uint32_t  flags = 0 
)
static

Read a double value from an ASCII stream.

◆ read_real_number() [2/2]

static bool datatools::io::read_real_number ( const std::string &  ,
double &  val,
bool &  normal,
uint32_t  flags = 0 
)
static

Read a double value from a string.

◆ red()

static std::ostream& datatools::io::red ( std::ostream &  )
static

◆ reverse()

static std::ostream& datatools::io::reverse ( std::ostream &  )
static

◆ right()

static std::ostream& datatools::io::right ( std::ostream &  )
static

◆ set_colored()

void datatools::io::set_colored ( bool  )

◆ showbase()

static std::ostream& datatools::io::showbase ( std::ostream &  )
static

◆ tab()

static std::ostream& datatools::io::tab ( std::ostream &  )
static

◆ to_binary()

static std::string datatools::io::to_binary ( const uint32_t &  val,
bool  show_all = false 
)
static

◆ to_binary_2()

static std::string datatools::io::to_binary_2 ( const uint32_t &  val)
static

◆ underline()

static std::ostream& datatools::io::underline ( std::ostream &  )
static

◆ verbose()

static std::ostream& datatools::io::verbose ( std::ostream &  )
static

◆ vtab()

static std::ostream& datatools::io::vtab ( std::ostream &  )
static

◆ warning()

static std::ostream& datatools::io::warning ( std::ostream &  )
static

◆ width()

static ostream_manipulator<int> datatools::io::width ( const int &  n)
static

◆ write_boolean()

static void datatools::io::write_boolean ( std::ostream &  a_out,
bool  a_bool,
bool  as_alpha = false 
)
static

Write a boolean.

◆ write_integer()

static void datatools::io::write_integer ( std::ostream &  ,
int   
)
static

Write an integer.

◆ write_quoted_string()

static void datatools::io::write_quoted_string ( std::ostream &  ,
const std::string &  a_str 
)
static

Write a quoted string.

◆ write_real_number()

static void datatools::io::write_real_number ( std::ostream &  out_,
double  val_,
int  precision_ = REAL_PRECISION,
const std::string &  unit_symbol_ = "",
const std::string &  unit_label_ = "",
double  unit_value_ = 1.0,
uint32_t  flags_ = 0 
)
static

Write a double value in an ASCII stream with unit support.

Member Data Documentation

◆ REAL4_PRECISION

const int datatools::io::REAL4_PRECISION = 8
static

Default precision for float.

◆ REAL8_PRECISION

const int datatools::io::REAL8_PRECISION = 16
static

Default precision for double.

◆ REAL_PRECISION

const int datatools::io::REAL_PRECISION = 16
static

Default precision for double.


The documentation for this struct was generated from the following file: