Public Attributes | List of all members
moot::TokenWriterNative Class Reference

Class for native "cooked" text-format token output.

Inheritance diagram for moot::TokenWriterNative:
Inheritance graph
[legend]
Collaboration diagram for moot::TokenWriterNative:
Collaboration graph
[legend]

Public Member Functions

Constructors etc.
 TokenWriterNative (int fmt=tiofWellDone, const std::string name="TokenWriterNative")
 
virtual ~TokenWriterNative (void)
 
Overrides
virtual void put_token (const mootToken &token)
 
virtual void put_tokens (const mootSentence &tokens)
 
virtual void put_sentence (const mootSentence &sentence)
 
virtual void put_raw_buffer (const char *buf, size_t len)
 
Output Utilities
void _put_token (const mootToken &token, mootio::mostream *os)
 
void _put_tokens (const mootSentence &tokens, mootio::mostream *os)
 
void _put_sentence (const mootSentence &sentence, mootio::mostream *os)
 
void _put_comment (const char *buf, size_t len, mootio::mostream *os)
 
void _put_raw_buffer (const char *buf, size_t len, mootio::mostream *os)
 
std::string token2string (const mootToken &token)
 
std::string sentence2string (const mootSentence &sentence)
 
- Public Member Functions inherited from moot::TokenWriter
 TokenWriter (int fmt=tiofWellDone, const std::string &name="TokenWriter")
 
virtual ~TokenWriter (void)
 
virtual void to_mstream (mootio::mostream *mostreamp)
 
virtual void to_mstream (mootio::mostream &mos)
 
virtual void to_filename (const char *filename)
 
virtual void to_file (FILE *file)
 
virtual void to_fd (int fd)
 
virtual void to_cxxstream (std::ostream &os)
 
virtual void close (void)
 
virtual bool opened (void)
 
virtual bool flush (void)
 
bool autoflush (mootio::mostream *os)
 
virtual void put_comment_block_begin (void)
 
virtual void put_comment_block_end (void)
 
virtual void put_comment_buffer (const char *buf, size_t len)
 
virtual void put_comment (const char *s)
 
virtual void put_comment_buffer (const std::string &s)
 
virtual void printf_comment (const char *fmt,...)
 
virtual void put_raw (const char *s)
 
virtual void put_raw (const std::string &s)
 
virtual void printf_raw (const char *fmt,...)
 
virtual void writer_name (const std::string &myname)
 
virtual void carp (const char *fmt,...)
 

Public Attributes

mootio::mocbuffer twn_tmpbuf
 
- Public Attributes inherited from moot::TokenWriter
int tw_format
 
std::string tw_name
 
mootio::mostreamtw_ostream
 
bool tw_ostream_created
 
bool tw_is_comment_block
 
void * tw_data
 

Additional Inherited Members

- Static Public Member Functions inherited from moot::TokenIO
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 TokenReadernew_reader (int fmt)
 
static class TokenWriternew_writer (int fmt)
 
static class TokenReaderfile_reader (const char *filename, const char *fmt_request=__null, int fmt_implied=tiofNone, int fmt_default=tiofNone)
 
static class TokenWriterfile_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)
 

Constructor & Destructor Documentation

◆ TokenWriterNative()

moot::TokenWriterNative::TokenWriterNative ( int  fmt = tiofWellDone,
const std::string  name = "TokenWriterNative" 
)
inline

Default constructor

References moot::tiofNative.

◆ ~TokenWriterNative()

virtual moot::TokenWriterNative::~TokenWriterNative ( void  )
inlinevirtual

Default destructor

Member Function Documentation

◆ put_token()

virtual void moot::TokenWriterNative::put_token ( const mootToken token)
inlinevirtual

Write a single token to the currently selected output sink. Descendants must override this method.

Reimplemented from moot::TokenWriter.

◆ put_tokens()

virtual void moot::TokenWriterNative::put_tokens ( const mootSentence tokens)
inlinevirtual

Write a single (partial) sentence to the currently selected output sink. Descendants may override this method. Default implementation just calls put_token() for every element of sentence.

Reimplemented from moot::TokenWriter.

◆ put_sentence()

virtual void moot::TokenWriterNative::put_sentence ( const mootSentence sentence)
inlinevirtual

Write a single sentence to the currently selected output sink. Descendants may override this method. Default implementation just calls put_sentence().

Reimplemented from moot::TokenWriter.

◆ put_raw_buffer()

virtual void moot::TokenWriterNative::put_raw_buffer ( const char *  buf,
size_t  len 
)
inlinevirtual

Write some data to the currently selected output sink Descendants may override this method.

Reimplemented from moot::TokenWriter.

◆ _put_token()

void moot::TokenWriterNative::_put_token ( const mootToken token,
mootio::mostream os 
)

Write a single token to a mootio::mostream (with eot marker)

◆ _put_tokens()

void moot::TokenWriterNative::_put_tokens ( const mootSentence tokens,
mootio::mostream os 
)

Write a partial sentence to a mootio::mostream (without eos marker)

◆ _put_sentence()

void moot::TokenWriterNative::_put_sentence ( const mootSentence sentence,
mootio::mostream os 
)

Write a whole sentence to a mootio::mostream (with eos marker)

◆ _put_comment()

void moot::TokenWriterNative::_put_comment ( const char *  buf,
size_t  len,
mootio::mostream os 
)

Write a raw comment to a mootio::mostream

◆ _put_raw_buffer()

void moot::TokenWriterNative::_put_raw_buffer ( const char *  buf,
size_t  len,
mootio::mostream os 
)

Write some raw data to a mootio::mostream, respecting tw_is_comment_block

◆ token2string()

std::string moot::TokenWriterNative::token2string ( const mootToken token)
inline

Clear internal buffer and stringify sentence into it, returning result as a new std::string

References mootio::mcbuffer::clear(), mootio::micbuffer::data(), and mootio::micbuffer::size().

◆ sentence2string()

std::string moot::TokenWriterNative::sentence2string ( const mootSentence sentence)
inline

Clear internal buffer and stringify sentence into it, returning result as a new std::string

References mootio::mcbuffer::clear(), mootio::micbuffer::data(), and mootio::micbuffer::size().

Member Data Documentation

◆ twn_tmpbuf

mootio::mocbuffer moot::TokenWriterNative::twn_tmpbuf

Temporary buffer for *2string methods


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