15 #ifndef ECL_STREAMS_OUTPUT_TEXT_STREAM_HPP_ 16 #define ECL_STREAMS_OUTPUT_TEXT_STREAM_HPP_ 24 #include <ecl/config/macros.hpp> 25 #include <ecl/exceptions/standard_exception.hpp> 26 #include <ecl/converters.hpp> 27 #include <ecl/concepts/devices.hpp> 28 #include "../manipulators/manipulator.hpp" 29 #include "../macros.hpp" 36 namespace interfaces {
54 template <
typename Device,
bool OutputDevice = true >
79 template <
typename Device>
80 class ECL_PUBLIC OutputTextStream<Device,true> :
public virtual BaseTextStream<Device> {
99 virtual ~OutputTextStream() {}
119 template <
typename Action>
122 manipulator.insert(*
this);
144 ecl::Converter<
char*> toCharString;
158 template <typename Device>
159 OutputTextStream<Device>& OutputTextStream<Device,true>::operator<< ( const
char& c )
ecl_assert_throw_decl(
ecl::StandardException) {
161 this->io_device.write(c);
172 template <
typename Device>
175 this->io_device.write(s,strlen(s));
187 template <
typename Device>
190 this->io_device.write(&s[0],
s.size());
200 template <
typename Device>
204 *
this << toCharString(i);
214 template <
typename Device>
218 *
this << toCharString(i);
229 template <
typename Device>
233 *
this << toCharString(i);
244 template <
typename Device>
248 *
this << toCharString(i);
259 template <
typename Device>
263 *
this << toCharString(i);
274 template <
typename Device>
278 *
this << toCharString(i);
289 template <
typename Device>
293 *
this << toCharString(i);
303 template <
typename Device>
307 *
this << toCharString(i);
317 template <
typename Device>
321 if ( b ) { *
this <<
"true"; }
else { *
this <<
"false"; };
331 template <
typename Device>
335 *
this << toCharString(f);
345 template <
typename Device>
349 *
this << toCharString(d);
360 template <
typename Device>
363 this->io_device.flush();
#define LOC
Stringify the line of code you are at.
class ECL_PUBLIC OutputTextStream
#define ecl_assert_throw(expression, exception)
Debug mode throw with a logical condition check.
OutputStream & operator<<(OutputStream &ostream, FormatNumber< N > &formatter) ecl_assert_throw_decl(StandardException)
Standard exception type, provides code location and error string.
#define ecl_assert_throw_decl(exception)
Assure throw exception declaration.
#define ecl_compile_time_concept_check(Model)
Compile time concept checking assertion.
OutputTextStream< Device > &operator<< (const char &c) ecl_assert_throw_decl(ecl OutputTextStream< Device > &operator<< (const char *s) ecl_assert_throw_decl(ecl OutputTextStream< Device > &operator<< (const std::string &s) ecl_assert_throw_decl(ecl OutputTextStream< Device > &operator<< (const short &i) ecl_assert_throw_decl(ecl OutputTextStream< Device > &operator<< (const int &i) ecl_assert_throw_decl(ecl OutputTextStream< Device > &operator<< (const long &i) ecl_assert_throw_decl(ecl OutputTextStream< Device > &operator<< (const long long &i) ecl_assert_throw_decl(ecl OutputTextStream< Device > &operator<< (const unsigned short &i) ecl_assert_throw_decl(ecl OutputTextStream< Device > &operator<< (const unsigned int &i) ecl_assert_throw_decl(ecl OutputTextStream< Device > &operator<< (const unsigned long &i) ecl_assert_throw_decl(ecl OutputTextStream< Device > &operator<< (const unsigned long long &i) ecl_assert_throw_decl(ecl OutputTextStream< Device > &operator<< (const bool b) ecl_assert_throw_decl(ecl OutputTextStream< Device > &operator<< (const float &f) ecl_assert_throw_decl(ecl OutputTextStream< Device > &operator<< (const double &d) ecl_assert_throw_decl(ecl OutputTextStream< Device > & operator<<(ecl::Manipulator< Action > &manipulator) ecl_assert_throw_decl(ecl