GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  STRINGLINE (3)

NAME

FBB::StringLine - extracting lines using operator>>

CONTENTS

SYNOPSIS

#include <bobcat/stringline>

DESCRIPTION

The standard operator>>(std::istream &, std::string &) 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 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.

NAMESPACE

FBB
All constructors, members, operators and manipulators, mentioned in this man-page, are defined in the namespace FBB.

INHERITS FROM

std::string

CONSTRUCTORS

StringLine is an empty shell around std::string. It does not explicitly define constructors. The default and copy constructors are available.

OVERLOADED OPERATOR

o 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 FUNCTIONS

All members of std::string are available, as FBB::StringLine inherits from these classes.

EXAMPLE

The 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) ); }

FILES

bobcat/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 ALSO

bobcat(7)

BUGS

None Reported.

DISTRIBUTION FILES

o bobcat_3.25.01-x.dsc: detached signature;
o bobcat_3.25.01-x.tar.gz: source archive;
o bobcat_3.25.01-x_i386.changes: change log;
o libbobcat1_3.25.01-x_*.deb: debian package holding the libraries;
o libbobcat1-dev_3.25.01-x_*.deb: debian package holding the libraries, headers and manual pages;
o http://sourceforge.net/projects/bobcat: public archive location;

BOBCAT

Bobcat is an acronym of ‘Brokken\(cqs Own Base Classes And Templates\(cq.

COPYRIGHT

This is free software, distributed under the terms of the GNU General Public License (GPL).

AUTHOR

Frank B. Brokken (f.b.brokken@rug.nl).

Search for    or go to Top of page |  Section 3 |  Main Index


libbobcat-dev_3&.25&.01-x&.tar&.gz FBB::STRINGLINE (3bobcat) 2005-2015

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.