Abstract class for token output.
|
static int | parse_format_string (const std::string &fmtString) |
|
static int | guess_filename_format (const char *filename) |
|
static bool | is_empty_format (int fmt) |
|
static int | sanitize_format (int fmt, int fmt_implied=tiofNone, int fmt_default=tiofNone) |
|
static int | parse_format_request (const char *request, const char *filename=__null, int fmt_implied=tiofNone, int fmt_default=tiofNone) |
|
static std::string | format_canonical_string (int fmt) |
|
static class TokenReader * | new_reader (int fmt) |
|
static class TokenWriter * | new_writer (int fmt) |
|
static class TokenReader * | file_reader (const char *filename, const char *fmt_request=__null, int fmt_implied=tiofNone, int fmt_default=tiofNone) |
|
static class TokenWriter * | file_writer (const char *filename, const char *fmt_request=__null, int fmt_implied=tiofNone, int fmt_default=tiofNone) |
|
static size_t | pipe_tokens (class TokenReader *reader, class TokenWriter *writer) |
|
static size_t | pipe_sentences (class TokenReader *reader, class TokenWriter *writer) |
|
◆ TokenWriter()
moot::TokenWriter::TokenWriter |
( |
int |
fmt = tiofWellDone , |
|
|
const std::string & |
name = "TokenWriter" |
|
) |
| |
|
inline |
Default constructor
- Parameters
-
fmt | output format: should be a bitmask of TokenIOFormatE flags |
name | name of TokenWriter subtype for diagnostics |
◆ ~TokenWriter()
virtual moot::TokenWriter::~TokenWriter |
( |
void |
| ) |
|
|
inlinevirtual |
◆ to_mstream() [1/2]
◆ to_mstream() [2/2]
Select output to a mootio::mistream object, reference version. Default implementation just calls to_mstream(&mos).
◆ to_filename()
virtual void moot::TokenWriter::to_filename |
( |
const char * |
filename | ) |
|
|
inlinevirtual |
Select output to a named file. Descendants using named file output may override this method. The filename "-" may be used to specify stdout.
References mootio::mstream::valid().
◆ to_file()
virtual void moot::TokenWriter::to_file |
( |
FILE * |
file | ) |
|
|
inlinevirtual |
Select output to a C stream. Caller is responsible for opening and closing the stream. Descendants using C stream output may override this method. Default implementation calls to_fd().
◆ to_fd()
virtual void moot::TokenWriter::to_fd |
( |
int |
fd | ) |
|
|
inlinevirtual |
Select output to a file descriptor. Caller is responsible for opening and closing the stream. Descendants using file descriptor may override this method. No default implementation.
◆ to_cxxstream()
virtual void moot::TokenWriter::to_cxxstream |
( |
std::ostream & |
os | ) |
|
|
inlinevirtual |
Select output to a C++ stream. Caller is responsible for allocation and de-allocation. Descendants using C++ stream input may override this method. Default implementation calls to_mstream().
◆ close()
virtual void moot::TokenWriter::close |
( |
void |
| ) |
|
|
inlinevirtual |
◆ opened()
virtual bool moot::TokenWriter::opened |
( |
void |
| ) |
|
|
inlinevirtual |
◆ flush()
virtual bool moot::TokenWriter::flush |
( |
void |
| ) |
|
|
inlinevirtual |
◆ autoflush()
◆ put_token()
virtual void moot::TokenWriter::put_token |
( |
const mootToken & |
token | ) |
|
|
inlinevirtual |
◆ put_tokens()
virtual void moot::TokenWriter::put_tokens |
( |
const mootSentence & |
tokens | ) |
|
|
inlinevirtual |
◆ put_sentence()
virtual void moot::TokenWriter::put_sentence |
( |
const mootSentence & |
sentence | ) |
|
|
inlinevirtual |
◆ put_comment_block_begin()
virtual void moot::TokenWriter::put_comment_block_begin |
( |
void |
| ) |
|
|
inlinevirtual |
Begin a comment block. This may effect behavior of subsequent put_raw_*() calls. Descendants using comments should override this method.
Reimplemented in moot::TokenWriterExpat.
◆ put_comment_block_end()
virtual void moot::TokenWriter::put_comment_block_end |
( |
void |
| ) |
|
|
inlinevirtual |
End a comment block. This may effect behavior of subsequent put_raw() calls. Descendants using comments should override this method.
Reimplemented in moot::TokenWriterExpat.
◆ put_comment_buffer() [1/2]
virtual void moot::TokenWriter::put_comment_buffer |
( |
const char * |
buf, |
|
|
size_t |
len |
|
) |
| |
|
inlinevirtual |
Write a single comment to the currently selected output sink Descendants may override this method.
◆ put_comment()
virtual void moot::TokenWriter::put_comment |
( |
const char * |
s | ) |
|
|
inlinevirtual |
Write a single comment to the currently selected output sink Descendants may override this method.
◆ put_comment_buffer() [2/2]
virtual void moot::TokenWriter::put_comment_buffer |
( |
const std::string & |
s | ) |
|
|
inlinevirtual |
Write a single comment to the currently selected output sink Descendants may override this method.
◆ printf_comment()
virtual void moot::TokenWriter::printf_comment |
( |
const char * |
fmt, |
|
|
|
... |
|
) |
| |
|
virtual |
Write a comment to the currently selected output sink, printf() style. Descendants may override this method.
◆ put_raw_buffer()
virtual void moot::TokenWriter::put_raw_buffer |
( |
const char * |
buf, |
|
|
size_t |
len |
|
) |
| |
|
inlinevirtual |
◆ put_raw() [1/2]
virtual void moot::TokenWriter::put_raw |
( |
const char * |
s | ) |
|
|
inlinevirtual |
Write some data to the currently selected output sink Descendants may override this method.
◆ put_raw() [2/2]
virtual void moot::TokenWriter::put_raw |
( |
const std::string & |
s | ) |
|
|
inlinevirtual |
Write some data to the currently selected output sink Descendants may override this method.
◆ printf_raw()
virtual void moot::TokenWriter::printf_raw |
( |
const char * |
fmt, |
|
|
|
... |
|
) |
| |
|
virtual |
◆ writer_name()
virtual void moot::TokenWriter::writer_name |
( |
const std::string & |
myname | ) |
|
|
inlinevirtual |
Set writer subtype name to use for diagnostics. Descendants may override this method.
◆ carp()
virtual void moot::TokenWriter::carp |
( |
const char * |
fmt, |
|
|
|
... |
|
) |
| |
|
virtual |
◆ tw_format
int moot::TokenWriter::tw_format |
◆ tw_name
std::string moot::TokenWriter::tw_name |
◆ tw_ostream
◆ tw_ostream_created
bool moot::TokenWriter::tw_ostream_created |
Whether we created tw_ostream
ourselves
◆ tw_is_comment_block
bool moot::TokenWriter::tw_is_comment_block |
Whether we're in a comment-block
◆ tw_data
void* moot::TokenWriter::tw_data |
User data associated with this writer object. Guaranteed to be unused by internal library routines. Useful e.g. for perl wrappers etc
The documentation for this class was generated from the following file: