mirror of
https://gitlab.com/fbb-git/cppannotations
synced 2024-11-16 07:48:44 +01:00
77314b045f
git-svn-id: https://cppannotations.svn.sourceforge.net/svnroot/cppannotations/trunk@536 f6dd340e-d3f9-0310-b409-bdd246841980
37 lines
1.8 KiB
Text
37 lines
1.8 KiB
Text
Several iostream related i(header file)s are available. Depending on
|
|
the situation at hand, the following header files should be used:
|
|
itemization(
|
|
iti(iosfwd): sources should include this header file if only a declaration
|
|
of the stream classes is required. For example, if a function defines a
|
|
reference parameter to an tt(ostream) then the compiler does not need to know
|
|
exactly what an tt(ostream) is. When declaring such a function
|
|
the tt(ostream) class merely needs to be be declared. One cannot use
|
|
verb(
|
|
class std::ostream; // erroneous declaration
|
|
|
|
void someFunction(std::ostream &str);
|
|
)
|
|
but, instead, one should use:
|
|
verb(
|
|
#include <iosfwd> // correctly declares class ostream
|
|
|
|
void someFunction(std::ostream &str);
|
|
)
|
|
ithi(streambuf): sources should include this header file when using
|
|
tt(streambuf) or ti(filebuf) classes. See sections ref(STREAMBUF) and
|
|
ref(FILEBUF).
|
|
ithi(istream): sources should include this preprocessor directive when
|
|
using the class tt(istream) or when using classes that do both input and
|
|
output. See section ref(ISTREAM).
|
|
ithi(ostream): sources should include this header file when using the class
|
|
ti(ostream) class or when using classes that do both input and output. See
|
|
section ref(OSTREAM).
|
|
ithi(iostream): sources should include this header file when using the
|
|
global stream objects (like ti(cin) and ti(cout)).
|
|
ithi(fstream): sources should include this header file when using the file
|
|
stream classes. See sections ref(OFSTREAM), ref(IFSTREAM), and ref(FSTREAM).
|
|
ithi(sstream): sources should include this header file when using the
|
|
string stream classes. See sections ref(OSTRINGSTREAM) and ref(ISTRINGSTREAM).
|
|
ithi(iomanip): sources should include this header file when using
|
|
parameterized manipulators. See section ref(IOFORMAT).
|
|
)
|