#include <maxtextfile.h>
This class is the base for all text file writers.
It declare a common interface to all implementations and expose a number of services to output formatted strings to a file.
Public Member Functions |
|
| virtual | ~BaseTextWriter () |
| virtual size_t | Write (const char *string, size_t nchars=(size_t)-1)=0 |
| Write a string. |
|
| virtual size_t | Write (const wchar_t *string, size_t nchars=(size_t)-1)=0 |
| Write an UTF-16 string. |
|
| virtual size_t | Write (const MaxString &String)=0 |
| Write an MaxString.
|
|
| virtual bool | CanWrite () const =0 |
| Returns true if we can write to file.
|
|
| virtual bool | IsFileOpen () const =0 |
| Returns true if file is open. |
|
| virtual void | Flush ()=0 |
| Make sure that all the buffer are synced
with the OS native objects. |
|
| virtual bool | IsEndOfFile () const =0 |
| Returns true if file at the end. |
|
| virtual size_t | Position () const =0 |
| Get the current position in the file.
|
|
| virtual size_t | Seek (long offset, int origin)=0 |
| Seek inside the stream. |
|
| size_t | Printf (const char *,...) |
| size_t | Vprintf (const char *, va_list) |
| virtual ~BaseTextWriter | ( | ) | [virtual] |
| virtual size_t Write | ( | const char * | string, |
| size_t | nchars =
(size_t)-1 |
||
| ) | [pure virtual] |
Write a string.
| string | String to write |
| nchars | Number of character to write. Default is size of string in characters |
Implemented in Writer, and ReaderWriter.
| virtual size_t Write | ( | const wchar_t * | string, |
| size_t | nchars =
(size_t)-1 |
||
| ) | [pure virtual] |
Write an UTF-16 string.
| string | String to write |
| nchars | Number of character to write. Default is size of string in characters |
Implemented in Writer, and ReaderWriter.
| virtual size_t Write | ( | const MaxString & | String | ) | [pure virtual] |
Write an MaxString.
| String | String to write |
Implemented in Writer, and ReaderWriter.
| virtual bool CanWrite | ( | ) | const [pure virtual] |
Returns true if we can write to file.
Implemented in Writer, and ReaderWriter.
| virtual bool IsFileOpen | ( | ) | const [pure virtual] |
| virtual void Flush | ( | ) | [pure virtual] |
Make sure that all the buffer are synced with the OS native objects.
Implemented in Writer, and ReaderWriter.
| virtual bool IsEndOfFile | ( | ) | const [pure virtual] |
Returns true if file at the end.
Implemented in Writer, and ReaderWriter.
| virtual size_t Position | ( | ) | const [pure virtual] |
Get the current position in the file.
Implemented in Writer, and ReaderWriter.
| virtual size_t Seek | ( | long | offset, |
| int | origin | ||
| ) | [pure virtual] |
Seek inside the stream.
| offset | The seeks operations are done in number of characters (not bytes). |
| origin | The direction to move. Origin can be one of the following * SEEK_CUR Current position of file pointer. * SEEK_END End of file. * SEEK_SET Beginning of file. |
Implemented in Writer, and ReaderWriter.
| size_t Printf | ( | const char * | , |
| ... | |||
| ) |
| size_t Vprintf | ( | const char * | , |
| va_list | |||
| ) |