libzypp
13.10.6
|
Iostream related utilities. More...
Classes | |
class | EachLine |
Simple lineparser: Traverse each line in a file. More... | |
Typedefs | |
typedef boost::io::ios_base_all_saver | IosFmtFlagsSaver |
Save and restore streams width , precision and fmtflags . More... | |
Enumerations | |
enum | ParseFlag { PF_LTRIM = 1 << 0, PF_RTRIM = 1 << 1, PF_TRIM = PF_LTRIM | PF_RTRIM, PF_SKIP_EMPTY = 1 << 2, PF_SKIP_SHARP_COMMENT = 1 << 3 } |
simpleParseFile modifications before consuming a line. More... | |
Functions | |
std::string | getline (std::istream &str) |
Read one line from stream. More... | |
int | forEachLine (std::istream &str_r, function< bool(int, std::string)> consume_r) |
Simple lineparser: Call functor consume_r for each line. More... | |
BOOST_MPL_ASSERT_RELATION (int(PF_LTRIM),==, int(str::L_TRIM)) | |
BOOST_MPL_ASSERT_RELATION (int(PF_RTRIM),==, int(str::R_TRIM)) | |
int | simpleParseFile (std::istream &str_r, ParseFlags flags_r, function< bool(int, std::string)> consume_r) |
Simple lineparser optionally trimming and skipping comments. More... | |
std::ostream & | copy (std::istream &from_r, std::ostream &to_r) |
Copy istream to ostream. More... | |
std::ostream & | copyIndent (std::istream &from_r, std::ostream &to_r, const std::string &indent_r="> ") |
Copy istream to ostream, prefixing each line with indent_r (default "> " ). More... | |
void | tee (std::istream &from_r, std::ostream &to1_r, std::ostream &to2_r) |
Copy istream to ostream, prefixing each line with indent_r (default "> " ). More... | |
ZYPP_DECLARE_FLAGS (ParseFlags, ParseFlag) | |
ZYPP_DECLARE_OPERATORS_FOR_FLAGS (ParseFlags) | |
int | simpleParseFile (std::istream &str_r, function< bool(int, std::string)> consume_r) |
Iostream related utilities.
typedef boost::io::ios_base_all_saver zypp::iostr::IosFmtFlagsSaver |
Save and restore streams width
, precision
and fmtflags
.
Definition at line 35 of file IOStream.h.
simpleParseFile modifications before consuming a line.
Enumerator | |
---|---|
PF_LTRIM | |
PF_RTRIM | |
PF_TRIM | |
PF_SKIP_EMPTY | |
PF_SKIP_SHARP_COMMENT |
Definition at line 188 of file IOStream.h.
std::string zypp::iostr::getline | ( | std::istream & | str | ) |
Read one line from stream.
Reads everything up to the next newline or EOF. newline is read but not returned.
Definition at line 33 of file IOStream.cc.
int zypp::iostr::forEachLine | ( | std::istream & | str_r, |
function< bool(int, std::string)> | consume_r | ||
) |
Simple lineparser: Call functor consume_r for each line.
str_r | istream to read from. |
consume_r | callback function taking linenumber and content |
The loop is aborted if the callback returns false
.
Definition at line 100 of file IOStream.cc.
zypp::iostr::BOOST_MPL_ASSERT_RELATION | ( | int(PF_LTRIM) | , |
int(str::L_TRIM) | |||
) |
zypp::iostr::BOOST_MPL_ASSERT_RELATION | ( | int(PF_RTRIM) | , |
int(str::R_TRIM) | |||
) |
int zypp::iostr::simpleParseFile | ( | std::istream & | str_r, |
ParseFlags | flags_r, | ||
function< bool(int, std::string)> | consume_r | ||
) |
Simple lineparser optionally trimming and skipping comments.
Definition at line 124 of file IOStream.cc.
|
inline |
|
inline |
Copy istream to ostream, prefixing each line with indent_r (default "> "
).
Definition at line 64 of file IOStream.h.
|
inline |
Copy istream to ostream, prefixing each line with indent_r (default "> "
).
Definition at line 84 of file IOStream.h.
zypp::iostr::ZYPP_DECLARE_FLAGS | ( | ParseFlags | , |
ParseFlag | |||
) |
zypp::iostr::ZYPP_DECLARE_OPERATORS_FOR_FLAGS | ( | ParseFlags | ) |
|
inline |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Definition at line 203 of file IOStream.h.