#include <wide_output.h>
Public Types | |
typedef aegis_shared_ptr < wide_output > | pointer |
Public Member Functions | |
virtual | ~wide_output () |
void | put_cstr (const char *text) |
void | put_ws (const wchar_t *wsp) |
void | put_wc (wchar_t wc) |
void | put_wstr (wstring_ty *wsp) |
void | write (const wstring &s) |
void | fputs (string_ty *s) |
virtual nstring | filename ()=0 |
void | write (const wchar_t *data, size_t len) |
void | flush () |
virtual int | page_width ()=0 |
virtual int | page_length ()=0 |
void | end_of_line () |
virtual const char * | type_name () const =0 |
void | register_delete_callback (functor::pointer func) |
void | unregister_delete_callback (functor::pointer func) |
Protected Member Functions | |
wide_output () | |
virtual void | write_inner (const wchar_t *data, size_t len)=0 |
virtual void | flush_inner ()=0 |
virtual void | end_of_line_inner ()=0 |
Private Member Functions | |
void | overflow (wchar_t wc) |
Private Attributes | |
wchar_t * | buffer |
size_t | buffer_size |
wchar_t * | buffer_position |
wchar_t * | buffer_end |
functor_stack | callback |
Definition at line 39 of file wide_output.h.
Definition at line 42 of file wide_output.h.
virtual wide_output::~wide_output | ( | ) | [virtual] |
The destructor.
wide_output::wide_output | ( | ) | [protected] |
The constructor.
void wide_output::put_cstr | ( | const char * | text | ) |
The put_cstr method is used to write a C string onto the output, after it has been converted to wide characters.
text | the string to convert and write |
void wide_output::put_ws | ( | const wchar_t * | wsp | ) |
The put_ws method is used to write a C wide string (for example, L"example") onto the output.
wsp | the string to write |
void wide_output::put_wc | ( | wchar_t | wc | ) | [inline] |
The put_wc method is used to write a single side charcter (for example, L'x') to the output stream.
wc | the wide character to be written |
Definition at line 82 of file wide_output.h.
void wide_output::put_wstr | ( | wstring_ty * | wsp | ) |
The put_wstr method is used to write a wide string onto the output stream.
wsp | the wide character string to be written |
void wide_output::write | ( | const wstring & | s | ) |
The write method is used to write a wide string onto the output stream.
s | the wide character string to be written |
void wide_output::fputs | ( | string_ty * | s | ) |
The fputs method is used to write a string onto the output stream.
s | the string to be converted and written |
virtual nstring wide_output::filename | ( | ) | [pure virtual] |
The filename method is used to obtain the name of the file being written by this output stream.
Implemented in wide_output_column, wide_output_expand, wide_output_head, wide_output_header, wide_output_to_narrow, wide_output_truncate, wide_output_unexpand, and wide_output_wrap.
void wide_output::write | ( | const wchar_t * | data, | |
size_t | len | |||
) |
The write method is used to write a set of wide charactres, e.g. a substring.
data | The data to be written | |
len | The number of wide characters to be written |
void wide_output::flush | ( | ) |
virtual int wide_output::page_width | ( | ) | [pure virtual] |
The page-width method is used to obtain the width (in printing columns) of the output destination.
Implemented in wide_output_column, wide_output_expand, wide_output_head, wide_output_header, wide_output_to_narrow, wide_output_truncate, wide_output_unexpand, and wide_output_wrap.
virtual int wide_output::page_length | ( | ) | [pure virtual] |
The length method is used to obtain the length (in whole lines) of the output destination.
Implemented in wide_output_column, wide_output_expand, wide_output_head, wide_output_header, wide_output_to_narrow, wide_output_truncate, wide_output_unexpand, and wide_output_wrap.
void wide_output::end_of_line | ( | ) |
virtual const char* wide_output::type_name | ( | ) | const [pure virtual] |
The type_name method is used to return the name of the class of output. Useful for debugging.
Implemented in wide_output_column, wide_output_expand, wide_output_head, wide_output_header, wide_output_to_narrow, wide_output_truncate, wide_output_unexpand, and wide_output_wrap.
void wide_output::register_delete_callback | ( | functor::pointer | func | ) |
void wide_output::unregister_delete_callback | ( | functor::pointer | func | ) |
The unregister_delete_callback method is used to rescind and earlier register_delete_callback call.
func | The functor not to be called |
virtual void wide_output::write_inner | ( | const wchar_t * | data, | |
size_t | len | |||
) | [protected, pure virtual] |
The write_inner method is called by the write method to emit buffered data.
data | The data to be written | |
len | The number of wide characters to be written |
Implemented in wide_output_column, wide_output_expand, wide_output_head, wide_output_header, wide_output_to_narrow, wide_output_truncate, wide_output_unexpand, and wide_output_wrap.
virtual void wide_output::flush_inner | ( | ) | [protected, pure virtual] |
The flush_inner method is called by the flush method, after it writes any buffered data via the write_inner method.
Implemented in wide_output_column, wide_output_expand, wide_output_head, wide_output_header, wide_output_to_narrow, wide_output_truncate, wide_output_unexpand, and wide_output_wrap.
virtual void wide_output::end_of_line_inner | ( | ) | [protected, pure virtual] |
The end_of_line_inner method is used to do end-of-line processing by the derived class, if the buffered character state is not sufficient for the end_of_line method to determine whether or not the output position is currently at the start of a line.
Implemented in wide_output_column, wide_output_expand, wide_output_head, wide_output_header, wide_output_to_narrow, wide_output_truncate, wide_output_unexpand, and wide_output_wrap.
void wide_output::overflow | ( | wchar_t | wc | ) | [private] |
wchar_t* wide_output::buffer [private] |
The buffer instance variable is used to remember the base address of a dynamically allocated array of wide characters, used to buffer the output and reduce the number of calles to the write_inner method.
Definition at line 222 of file wide_output.h.
size_t wide_output::buffer_size [private] |
The buffer_size instance variable is used to remember the allocated size (in wide characters) of the buffer instance variable.
Definition at line 229 of file wide_output.h.
wchar_t* wide_output::buffer_position [private] |
The buffer_position instance variable is used to remember the current write position (for the next call to put_wc) in the buffer of data.
assert(buffer <= buffer_position); assert(buffer_position <= buffer_end);
Definition at line 239 of file wide_output.h.
wchar_t* wide_output::buffer_end [private] |
The buffer_end instance variable is used to remember the address which is immediately beyond the end of the allocated buffer array. This is used by put_wc to know when to call the overflow method.
assert(buffer_end == buffer + buffer_size);
Definition at line 249 of file wide_output.h.
functor_stack wide_output::callback [private] |
The callback instance variable is used to remember the fallback(s), if any, to call when this instance is destroyed.
Definition at line 255 of file wide_output.h.