.TH "FBB::StringLine" "3bobcat" "2005\-2023" "libbobcat\-dev_6\&.04\&.00" "Line extractor" .PP .SH "NAME" FBB::StringLine \- extracting lines using operator>> .PP .SH "SYNOPSIS" \fB#include \fP .br .PP .SH "DESCRIPTION" The standard \fIoperator>>(std::istream &, std::string &)\fP string extracion operator extracts the first `word\(cq\& from a stream\&. In cases where the intent it to extract lines from the stream this operator cannot be used, but \fIgetline(std::istream &, std::string &)\fP is usually called\&. .PP However, \fIgetline\fP is not called by many tools of generic algorithms, like the \fIistream_iterator\fP\&. .PP The class (actually: struct) \fIStringLine\fP was simply derived from \fIstd::string\fP, and defines its own \fIoperator>>\fP, reading the next line from the specified \fIstd::istream\fP\&. .PP .SH "NAMESPACE" \fBFBB\fP .br All constructors, members, operators and manipulators, mentioned in this man\-page, are defined in the namespace \fBFBB\fP\&. .PP .SH "INHERITS FROM" \fIstd::string\fP .PP .SH "CONSTRUCTORS" \fIStringLine\fP is an empty shell around \fIstd::string\fP\&. It does not explicitly define constructors\&. .PP Copy and move constructors (and assignment operators) are available\&. .PP .SH "OVERLOADED OPERATOR" .IP o \fBstd::istream &operator>>(std::istream &in, StringLine &str)\fP: .br The extraction operator returns the next line on \fIin\fP in \fIstr\fP, calling \fIgetline(std::istream &, std::string &)\fP\&. .PP .SH "MEMBER FUNCTIONS" All members of \fBstd::string\fP are available, as \fBFBB::StringLine\fP inherits from these classes\&. .PP .SH "EXAMPLE" The following example extracts all lines from \fIstd::cin\fP and adds them to the \fIstd::vector lines\fP: .nf #include #include #include #include #include using namespace std; using namespace FBB; int main() { vector lines; copy( istream_iterator(cin), istream_iterator(), back_inserter(lines) ); } .fi .PP .SH "FILES" \fIbobcat/stringline\fP \- defines the class interface and \fIoperator>>\fP\&. .PP There are \fIStringLine\fP object files in the Bobcat library, so linking to Bobcat when using \fIStringLine\fP is not necessary\&. .PP .SH "SEE ALSO" \fBbobcat\fP(7) .PP .SH "BUGS" None Reported\&. .PP .SH "BOBCAT PROJECT FILES" .PP .IP o \fIhttps://fbb\-git\&.gitlab\&.io/bobcat/\fP: gitlab project page; .IP o \fIbobcat_6\&.04\&.00\-x\&.dsc\fP: detached signature; .IP o \fIbobcat_6\&.04\&.00\-x\&.tar\&.gz\fP: source archive; .IP o \fIbobcat_6\&.04\&.00\-x_i386\&.changes\fP: change log; .IP o \fIlibbobcat1_6\&.04\&.00\-x_*\&.deb\fP: debian package containing the libraries; .IP o \fIlibbobcat1\-dev_6\&.04\&.00\-x_*\&.deb\fP: debian package containing the libraries, headers and manual pages; .PP .SH "BOBCAT" Bobcat is an acronym of `Brokken\(cq\&s Own Base Classes And Templates\(cq\&\&. .PP .SH "COPYRIGHT" This is free software, distributed under the terms of the GNU General Public License (GPL)\&. .PP .SH "AUTHOR" Frank B\&. Brokken (\fBf\&.b\&.brokken@rug\&.nl\fP)\&. .PP