Query: stringline
OS: debian
Section: 3bobcat
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
FBB::StringLine(3bobcat) Line extractor FBB::StringLine(3bobcat)NAMEFBB::StringLine - extracting lines using operator>>SYNOPSIS#include <bobcat/stringline>DESCRIPTIONThe standard operator>>(std::istream &, std::string &) string extracion operator extracts the first `word' from a stream. In cases where the intent it to extract lines from the stream this operator cannot be used, but getline(std::istream &, std::string &) is usually called. However, getline is not called by many tools of generic algorithms, like the istream_iterator. The class (actually: struct) StringLine was simply derived from std::string, and defines its own operator>>, reading the next line from the specified std::istream.NAMESPACEFBB All constructors, members, operators and manipulators, mentioned in this man-page, are defined in the namespace FBB.INHERITS FROMstd::stringCONSTRUCTORSStringLine is an empty shell around std::string. It does not explicitly define constructors. The default and copy constructors are avail- able.OVERLOADED OPERATORo std::istream &operator>>(std::istream &in, StringLine &str): The extraction operator returns the next line on in in str, calling getline(std::istream &, std::string &).MEMBER FUNCTIONSAll members of std::string are available, as FBB::StringLine inherits from these classes.EXAMPLEThe following example extracts all lines from std::cin and adds them to the std::vector<std::string> lines: #include <iostream> #include <algorithm> #include <iterator> #include <vector> #include <bobcat/stringline> using namespace std; using namespace FBB; int main() { vector<string> lines; copy( istream_iterator<StringLine>(cin), istream_iterator<StringLine>(), back_inserter(lines) ); }FILESbobcat/stringline - defines the class interface and operator>>. There are StringLine object files in the Bobcat library, so linking to Bobcat when using StringLine is not necessary.SEE ALSObobcat(7)BUGSNone Reported.DISTRIBUTION FILESo bobcat_3.01.00-x.dsc: detached signature; o bobcat_3.01.00-x.tar.gz: source archive; o bobcat_3.01.00-x_i386.changes: change log; o libbobcat1_3.01.00-x_*.deb: debian package holding the libraries; o libbobcat1-dev_3.01.00-x_*.deb: debian package holding the libraries, headers and manual pages; o http://sourceforge.net/projects/bobcat: public archive location;BOBCATBobcat is an acronym of `Brokken's Own Base Classes And Templates'.COPYRIGHTThis is free software, distributed under the terms of the GNU General Public License (GPL).AUTHORFrank B. Brokken (f.b.brokken@rug.nl). libbobcat1-dev_3.01.00-x.tar.gz 2005-2012 FBB::StringLine(3bobcat)
Related Man Pages |
---|
iostream(3bobcat) - centos |
iostream(3bobcat) - mojave |
iostream(3bobcat) - hpux |
iostream(3bobcat) - posix |
iostream(3bobcat) - x11r4 |
Similar Topics in the Unix Linux Community |
---|
How to Get Timed Input using cin |
C++ cin problem |
Inline function inside Classes |
extract a string from main string |
Do not mix RFA_String and std::string in Reuters RFA !!!!!!! |