Template Class OutputTextStream< Device, true >
Defined in File output_text_stream.hpp
Inheritance Relationships
Base Type
public ecl::interfaces::BaseTextStream< Device >
(Template Class BaseTextStream)
Class Documentation
-
template<typename Device>
class OutputTextStream<Device, true> : public virtual ecl::interfaces::BaseTextStream<Device> Output text stream interface.
Defines the appropriate functionality required for output text streams.
Usage:
Instantiate
Open the underlying device
Stream
TextStream<OFile> ofstream; ofstream.device().open("dudes.txt",New); ofstream << "dudes " << 32.36; ofstream.flush();
- Template Parameters:
Device – : this must be a class that satisfies the output device concept (refer to the documentation in ecl_concepts for details).
Public Functions
-
inline OutputTextStream()
Connects the stream to an output device.
Connects the text stream to the associated output device. Use the device() handle to properly open the device, e.g.
OutputTextStream<OFile> ofstream; ofstream.device().open("dudes.txt",New);
-
inline virtual ~OutputTextStream()
-
OutputTextStream<Device> &operator<<(const char &c)
Sends an unformatted char to the stream. Sends an unformatted char to the stream.
- Parameters:
c – : input value being sent to the stream
- Throws:
ecl::StandardException – : throws if the underlying device has not been opened [debug mode only].
- Returns:
OutputTextStream : returns the stream for further manipulation
-
OutputTextStream<Device> &operator<<(const char *s)
Sends an unformatted char string to the stream. Sends an unformatted char string to the stream.
- Parameters:
s – : input value being sent to the stream
- Throws:
ecl::StandardException – : throws if the underlying device has not been opened [debug mode only].
- Returns:
OutputTextStream : returns the stream for further manipulation
-
OutputTextStream<Device> &operator<<(const std::string &s)
Sends an unformatted string to the stream. Sends an unformatted string to the stream.
- Parameters:
s – : input value being sent to the stream
- Throws:
ecl::StandardException – : throws if the underlying device has not been opened [debug mode only].
- Returns:
OutputTextStream : returns the stream for further manipulation
-
OutputTextStream<Device> &operator<<(const short &i)
Sends an unformatted short to the stream. Sends an unformatted short to the stream.
- Parameters:
i – : input value being sent to the stream
- Throws:
ecl::StandardException – : throws if the underlying device has not been opened [debug mode only].
- Returns:
OutputTextStream : returns the stream for further manipulation
-
OutputTextStream<Device> &operator<<(const int &i)
Sends an unformatted int to the stream. Sends an unformatted int to the stream.
- Parameters:
i – : input value being sent to the stream
- Throws:
ecl::StandardException – : throws if the underlying device has not been opened [debug mode only].
- Returns:
OutputTextStream : returns the stream for further manipulation
-
OutputTextStream<Device> &operator<<(const long &i)
Sends an unformatted long to the stream. Sends an unformatted long to the stream.
- Parameters:
i – : input value being sent to the stream
- Throws:
ecl::StandardException – : throws if the underlying device has not been opened [debug mode only].
- Returns:
OutputTextStream : returns the stream for further manipulation
-
OutputTextStream<Device> &operator<<(const long long &i)
Sends an unformatted long long to the stream. Sends an unformatted long long to the stream.
- Parameters:
i – : input value being sent to the stream
- Throws:
ecl::StandardException – : throws if the underlying device has not been opened [debug mode only].
- Returns:
OutputTextStream : returns the stream for further manipulation
-
OutputTextStream<Device> &operator<<(const unsigned short &i)
Sends an unformatted unsigned short to the stream. Sends an unformatted unsigned short to the stream.
- Parameters:
i – : input value being sent to the stream
- Throws:
ecl::StandardException – : throws if the underlying device has not been opened [debug mode only].
- Returns:
OutputTextStream : returns the stream for further manipulation
-
OutputTextStream<Device> &operator<<(const unsigned int &i)
Sends an unformatted unsigned int to the stream. Sends an unformatted unsigned int to the stream.
- Parameters:
i – : input value being sent to the stream
- Throws:
ecl::StandardException – : throws if the underlying device has not been opened [debug mode only].
- Returns:
OutputTextStream : returns the stream for further manipulation
-
OutputTextStream<Device> &operator<<(const unsigned long &i)
Sends an unformatted unsigned long to the stream. Sends an unformatted unsigned long to the stream.
- Parameters:
i – : input value being sent to the stream
- Throws:
ecl::StandardException – : throws if the underlying device has not been opened [debug mode only].
- Returns:
OutputTextStream : returns the stream for further manipulation
-
OutputTextStream<Device> &operator<<(const unsigned long long &i)
Sends an unformatted unsigned long long to the stream. Sends an unformatted unsigned long long to the stream.
- Parameters:
i – : input value being sent to the stream
- Throws:
ecl::StandardException – : throws if the underlying device has not been opened [debug mode only].
- Returns:
OutputTextStream : returns the stream for further manipulation
-
OutputTextStream<Device> &operator<<(const bool b)
Sends a boolean to the stream. Sends a boolean to the stream.
- Parameters:
b – : input value being sent to the stream
- Throws:
ecl::StandardException – : throws if the underlying device has not been opened [debug mode only].
- Returns:
OutputTextStream : returns the stream for further manipulation
-
OutputTextStream<Device> &operator<<(const float &f)
Sends an unformatted float to the stream.
- Parameters:
f – : input value being sent to the stream
- Throws:
ecl::StandardException – : throws if the underlying device has not been opened [debug mode only].
- Returns:
OutputTextStream : returns the stream for further manipulation
-
OutputTextStream<Device> &operator<<(const double &d)
Sends an unformatted double to the stream.
- Parameters:
d – : input value being sent to the stream
- Throws:
ecl::StandardException – : throws if the underlying device has not been opened [debug mode only].
- Returns:
OutputTextStream : returns the stream for further manipulation.
-
template<typename Action>
inline OutputTextStream<Device> &operator<<(ecl::Manipulator<Action> &manipulator)
-
void flush()
Flushes the underlying device’s buffer.
Provides a streaming operator for handling output textstream manipulators. Manipulators are simple functions that accept the stream as input and manipulate it in a minor way. They can hold no state. The most common example of such a manipulator is the endln manipulator. This manipulator works in the same fashion as the c++ endl manipulator.
Flushes the underlying device’s buffer.
- Throws:
ecl::StandardException – : throws if the underlying device has not been opened [debug mode only].