1 #ifndef DATATOOLS_IOUTILS_H 3 #define DATATOOLS_IOUTILS_H 12 #include <boost/cstdint.hpp> 20 const std::string & text_,
21 const std::string & indent_ =
"");
32 : _function_(function_), _value_(value_)
40 return manip_._function_(os_, manip_._value_);
45 std::ostream & (*_function_)(std::ostream &,
const T &);
60 : _function_(function_), _value_(value_)
68 return manip_._function_(os_, manip_._value_);
73 std::ostream & (*_function_)(std::ostream &, T &);
135 std::ostream&
operator()(std::ostream&)
const;
152 std::string & app_name_,
153 std::vector<std::string> & args_);
156 static bool read_boolean(std::istream&,
bool&, uint32_t flags = 0);
159 static bool read_boolean(
const std::string&,
bool&, uint32_t flags = 0);
162 static void write_boolean(std::ostream& a_out,
bool a_bool,
bool as_alpha =
false);
165 static bool read_integer(std::istream&,
int&, uint32_t flags = 0);
168 static bool read_integer(
const std::string&,
int&, uint32_t flags = 0);
192 const std::string& unit_symbol_ =
"",
193 const std::string& unit_label_ =
"",
194 double unit_value_ = 1.0,
195 uint32_t flags_ = 0);
201 static std::ostream&
normal(std::ostream&);
203 static std::ostream&
reverse(std::ostream&);
205 static std::ostream&
bold(std::ostream&);
207 static std::ostream&
underline(std::ostream&);
209 static std::ostream&
red(std::ostream&);
211 static std::ostream&
green(std::ostream&);
213 static std::ostream&
debug(std::ostream&);
215 static std::ostream&
devel(std::ostream&);
217 static std::ostream&
notice(std::ostream&);
219 static std::ostream&
warning(std::ostream&);
221 static std::ostream&
error(std::ostream&);
223 static std::ostream&
verbose(std::ostream&);
225 static std::ostream&
tab(std::ostream&);
227 static std::ostream&
vtab(std::ostream&);
229 static std::ostream&
page_break(std::ostream&);
231 static std::ostream&
left(std::ostream&);
233 static std::ostream&
right(std::ostream&);
235 static std::ostream&
internal(std::ostream&);
237 static std::ostream&
showbase(std::ostream&);
239 static std::ostream&
ostream_width(std::ostream& os,
const int& n);
247 static std::string
to_binary(
const uint32_t& val,
bool show_all =
false);
249 static std::string
to_binary_2(
const uint32_t& val);
270 bool _colored_stream_;
276 #endif // DATATOOLS_IOUTILS_H