xtd 0.2.0
Loading...
Searching...
No Matches
xtd::io::text_writer Class Reference
Inheritance diagram for xtd::io::text_writer:
xtd::object xtd::io::null_text_writer xtd::io::stream_writer xtd::io::string_writer xtd::io::synchronized_text_writer

Definition

Represents a writer that can write a sequential series of characters.

text_writer()=default
Initializes a new instance of the xtd::io::text_writer class.
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition object.hpp:45
#define core_export_
Define shared library export.
Definition core_export.hpp:13
Inheritance
xtd::objectxtd::io::text_writer
Header
#include <xtd/io/text_writer>
Namespace
xtd::io
Library
xtd.core

Public Fields

static auto null () noexcept -> null_text_writer &
 Provides a text_writer with no backing store that can be written to, but not read from.
 

Public Static Methods

static auto synchronised (text_writer &writer) noexcept -> synchronized_text_writer
 Creates a thread-safe (synchronized) wrapper around the specified text_writer object.
 

Public Properties

auto new_line () const noexcept -> const xtd::string &
 Gets the line terminator string used by the current text_writer.
 
auto new_line (const xtd::string &new_line) noexcept -> void
 Sets the line terminator string used by the current text_writer.
 

Public Methods

virtual auto close () -> void
 Closes the xtd::io::text_reader and releases any system resources associated with the text_reader.
 
virtual auto flush () -> void
 Clears all buffers for the current writer and causes any buffered data to be written to the underlying device.
 
virtual auto write (const xtd::string &value) -> void
 Writes the specified string value to the text stream.
 
auto write (bool value) -> void
 Writes the specified bool value to the text stream.
 
auto write (double value) -> void
 Writes the specified double value to the text stream.
 
auto write (float value) -> void
 Writes the specified float value to the text stream.
 
auto write (sbyte value) -> void
 Writes the specified sbyte value to the text stream.
 
auto write (int16 value) -> void
 Writes the specified int16 value to the text stream.
 
auto write (int32 value) -> void
 Writes the specified int32 value to the text stream.
 
auto write (int64 value) -> void
 Writes the specified int64 value to the text stream.
 
auto write (xtd::byte value) -> void
 Writes the specified xtd::byte value to the text stream.
 
auto write (uint16 value) -> void
 Writes the specified uint16 value to the text stream.
 
auto write (uint32 value) -> void
 Writes the specified uint32 value to the text stream.
 
auto write (uint64 value) -> void
 Writes the specified uint64 value to the text stream.
 
template<class value_t>
auto write (value_t value) -> void
 Writes the specified value_t value to the text stream.
 
template<class ... args_t>
auto write (const xtd::string &fmt, args_t &&... args) noexcept -> void
 Writes the specified arguments with specified format to the text stream.
 
auto write_line () -> void
 Writes new line to the text stream.
 
auto write_line (const xtd::string &value) -> void
 Writes the specified string value and new line to the text stream.
 
auto write_line (bool value) -> void
 Writes the specified bool value and new line to the text stream.
 
auto write_line (double value) -> void
 Writes the specified double value and new line to the text stream.
 
auto write_line (float value) -> void
 Writes the specified float value and new line to the text stream.
 
auto write_line (sbyte value) -> void
 Writes the specified sbyte value and new line to the text stream.
 
auto write_line (int16 value) -> void
 Writes the specified int16 value and new line to the text stream.
 
auto write_line (int32 value) -> void
 Writes the specified int32 value and new line to the text stream.
 
auto write_line (int64 value) -> void
 Writes the specified int64 value and new line to the text stream.
 
auto write_line (xtd::byte value) -> void
 Writes the specified xtd::byte value and new line to the text stream.
 
auto write_line (uint16 value) -> void
 Writes the specified uint16 value and new line to the text stream.
 
auto write_line (uint32 value) -> void
 Writes the specified uint32 value and new line to the text stream.
 
auto write_line (uint64 value) -> void
 Writes the specified uint64 value and new line to the text stream.
 
template<class value_t>
auto write_line (value_t value) -> void
 Writes the specified value_t value and new line to the text stream.
 
template<class ... args_t>
auto write_line (const xtd::string &fmt, args_t &&... args) noexcept -> void
 Writes the specified arguments with specified format to the text stream.
 

Protected constructors

 text_writer ()=default
 Initializes a new instance of the xtd::io::text_writer class.
 

Additional Inherited Members

 object ()=default
 Create a new instance of the ultimate base class object.
 
virtual bool equals (const object &obj) const noexcept
 Determines whether the specified object is equal to the current object.
 
virtual xtd::size get_hash_code () const noexcept
 Serves as a hash function for a particular type.
 
virtual type_object get_type () const noexcept
 Gets the type of the current instance.
 
template<class object_t>
xtd::unique_ptr_object< object_t > memberwise_clone () const
 Creates a shallow copy of the current object.
 
virtual xtd::string to_string () const
 Returns a xtd::string that represents the current object.
 
template<class object_a_t, class object_b_t>
static bool equals (const object_a_t &object_a, const object_b_t &object_b) noexcept
 Determines whether the specified object instances are considered equal.
 
template<class object_a_t, class object_b_t>
static bool reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept
 Determines whether the specified object instances are the same instance.
 

Constructor & Destructor Documentation

◆ text_writer()

xtd::io::text_writer::text_writer ( )
protecteddefault

Initializes a new instance of the xtd::io::text_writer class.

Member Function Documentation

◆ null()

static auto xtd::io::text_writer::null ( ) -> null_text_writer &
staticnodiscardnoexcept

Provides a text_writer with no backing store that can be written to, but not read from.

Remarks
Use null to redirect output to a stream that will not consume any operating system resources.
When the text_writer::write methods are invoked on null, the call simply returns, and no data is actually written to any backing store.

◆ new_line() [1/2]

auto xtd::io::text_writer::new_line ( ) const -> const xtd::string &
nodiscardnoexcept

Gets the line terminator string used by the current text_writer.

◆ new_line() [2/2]

auto xtd::io::text_writer::new_line ( const xtd::string & new_line) -> void
noexcept

Sets the line terminator string used by the current text_writer.

◆ close()

virtual auto xtd::io::text_writer::close ( ) -> void
virtual

Closes the xtd::io::text_reader and releases any system resources associated with the text_reader.

Reimplemented in xtd::io::stream_writer.

◆ flush()

virtual auto xtd::io::text_writer::flush ( ) -> void
virtual

Clears all buffers for the current writer and causes any buffered data to be written to the underlying device.

Remarks
This default method does nothing, but derived classes can virtual the method to provide the appropriate functionality

Reimplemented in xtd::io::stream_writer, and xtd::io::string_writer.

◆ write() [1/14]

virtual auto xtd::io::text_writer::write ( const xtd::string & value) -> void
virtual

Writes the specified string value to the text stream.

Parameters
valueThe value to write.
Exceptions
io::io_exceptionAn I/O error occurs.

Reimplemented in xtd::io::null_text_writer, xtd::io::stream_writer, xtd::io::string_writer, and xtd::io::synchronized_text_writer.

◆ write() [2/14]

auto xtd::io::text_writer::write ( bool value) -> void

Writes the specified bool value to the text stream.

Parameters
valueThe value to write.
Exceptions
io::io_exceptionAn I/O error occurs.

◆ write() [3/14]

auto xtd::io::text_writer::write ( double value) -> void

Writes the specified double value to the text stream.

Parameters
valueThe value to write.
Exceptions
io::io_exceptionAn I/O error occurs.

◆ write() [4/14]

auto xtd::io::text_writer::write ( float value) -> void

Writes the specified float value to the text stream.

Parameters
valueThe value to write.
Exceptions
io::io_exceptionAn I/O error occurs.

◆ write() [5/14]

auto xtd::io::text_writer::write ( sbyte value) -> void

Writes the specified sbyte value to the text stream.

Parameters
valueThe value to write.
Exceptions
io::io_exceptionAn I/O error occurs.

◆ write() [6/14]

auto xtd::io::text_writer::write ( int16 value) -> void

Writes the specified int16 value to the text stream.

Parameters
valueThe value to write.
Exceptions
io::io_exceptionAn I/O error occurs.

◆ write() [7/14]

auto xtd::io::text_writer::write ( int32 value) -> void

Writes the specified int32 value to the text stream.

Parameters
valueThe value to write.
Exceptions
io::io_exceptionAn I/O error occurs.

◆ write() [8/14]

auto xtd::io::text_writer::write ( int64 value) -> void

Writes the specified int64 value to the text stream.

Parameters
valueThe value to write.
Exceptions
io::io_exceptionAn I/O error occurs.

◆ write() [9/14]

auto xtd::io::text_writer::write ( xtd::byte value) -> void

Writes the specified xtd::byte value to the text stream.

Parameters
valueThe value to write.
Exceptions
io::io_exceptionAn I/O error occurs.

◆ write() [10/14]

auto xtd::io::text_writer::write ( uint16 value) -> void

Writes the specified uint16 value to the text stream.

Parameters
valueThe value to write.
Exceptions
io::io_exceptionAn I/O error occurs.

◆ write() [11/14]

auto xtd::io::text_writer::write ( uint32 value) -> void

Writes the specified uint32 value to the text stream.

Parameters
valueThe value to write.
Exceptions
io::io_exceptionAn I/O error occurs.

◆ write() [12/14]

auto xtd::io::text_writer::write ( uint64 value) -> void

Writes the specified uint64 value to the text stream.

Parameters
valueThe value to write.
Exceptions
io::io_exceptionAn I/O error occurs.

◆ write() [13/14]

template<class value_t>
auto xtd::io::text_writer::write ( value_t value) -> void
inline

Writes the specified value_t value to the text stream.

Template Parameters
value_tThe type of value to write.
Parameters
valueThe value to write.
Exceptions
io::io_exceptionAn I/O error occurs.

◆ write() [14/14]

template<class ... args_t>
auto xtd::io::text_writer::write ( const xtd::string & fmt,
args_t &&... args ) -> void
inlinenoexcept

Writes the specified arguments with specified format to the text stream.

Parameters
formatThe arguments format to write.
argsThe arguments to write with format
Exceptions
io::io_exceptionAn I/O error occurs.

◆ write_line() [1/15]

auto xtd::io::text_writer::write_line ( ) -> void

Writes new line to the text stream.

Exceptions
io::io_exceptionAn I/O error occurs.

◆ write_line() [2/15]

auto xtd::io::text_writer::write_line ( const xtd::string & value) -> void

Writes the specified string value and new line to the text stream.

Parameters
valueThe value to write.
Exceptions
io::io_exceptionAn I/O error occurs.

◆ write_line() [3/15]

auto xtd::io::text_writer::write_line ( bool value) -> void

Writes the specified bool value and new line to the text stream.

Parameters
valueThe value to write.
Exceptions
io::io_exceptionAn I/O error occurs.

◆ write_line() [4/15]

auto xtd::io::text_writer::write_line ( double value) -> void

Writes the specified double value and new line to the text stream.

Parameters
valueThe value to write.
Exceptions
io::io_exceptionAn I/O error occurs.

◆ write_line() [5/15]

auto xtd::io::text_writer::write_line ( float value) -> void

Writes the specified float value and new line to the text stream.

Parameters
valueThe value to write.
Exceptions
io::io_exceptionAn I/O error occurs.

◆ write_line() [6/15]

auto xtd::io::text_writer::write_line ( sbyte value) -> void

Writes the specified sbyte value and new line to the text stream.

Parameters
valueThe value to write.
Exceptions
io::io_exceptionAn I/O error occurs.

◆ write_line() [7/15]

auto xtd::io::text_writer::write_line ( int16 value) -> void

Writes the specified int16 value and new line to the text stream.

Parameters
valueThe value to write.
Exceptions
io::io_exceptionAn I/O error occurs.

◆ write_line() [8/15]

auto xtd::io::text_writer::write_line ( int32 value) -> void

Writes the specified int32 value and new line to the text stream.

Parameters
valueThe value to write.
Exceptions
io::io_exceptionAn I/O error occurs.

◆ write_line() [9/15]

auto xtd::io::text_writer::write_line ( int64 value) -> void

Writes the specified int64 value and new line to the text stream.

Parameters
valueThe value to write.
Exceptions
io::io_exceptionAn I/O error occurs.

◆ write_line() [10/15]

auto xtd::io::text_writer::write_line ( xtd::byte value) -> void

Writes the specified xtd::byte value and new line to the text stream.

Parameters
valueThe value to write.
Exceptions
io::io_exceptionAn I/O error occurs.

◆ write_line() [11/15]

auto xtd::io::text_writer::write_line ( uint16 value) -> void

Writes the specified uint16 value and new line to the text stream.

Parameters
valueThe value to write.
Exceptions
io::io_exceptionAn I/O error occurs.

◆ write_line() [12/15]

auto xtd::io::text_writer::write_line ( uint32 value) -> void

Writes the specified uint32 value and new line to the text stream.

Parameters
valueThe value to write.
Exceptions
io::io_exceptionAn I/O error occurs.

◆ write_line() [13/15]

auto xtd::io::text_writer::write_line ( uint64 value) -> void

Writes the specified uint64 value and new line to the text stream.

Parameters
valueThe value to write.
Exceptions
io::io_exceptionAn I/O error occurs.

◆ write_line() [14/15]

template<class value_t>
auto xtd::io::text_writer::write_line ( value_t value) -> void
inline

Writes the specified value_t value and new line to the text stream.

Template Parameters
value_tThe type of value to write.
Parameters
valueThe value to write.
Exceptions
io::io_exceptionAn I/O error occurs.

◆ write_line() [15/15]

template<class ... args_t>
auto xtd::io::text_writer::write_line ( const xtd::string & fmt,
args_t &&... args ) -> void
inlinenoexcept

Writes the specified arguments with specified format to the text stream.

Parameters
formatThe arguments format to write.
argsThe arguments to write with format.
Exceptions
io::io_exceptionAn I/O error occurs.

◆ synchronised()

static auto xtd::io::text_writer::synchronised ( text_writer & writer) -> synchronized_text_writer
staticnodiscardnoexcept

Creates a thread-safe (synchronized) wrapper around the specified text_writer object.

Parameters
readerThe TextReader object to synchronize.
Returns
text_writer A thread-safe text_writer object.

The documentation for this class was generated from the following file: