KiCad PCB EDA Suite
numEval::STREAM_OUTPUTFORMATTER Class Reference

Class STREAM_OUTPUTFORMATTER implements OUTPUTFORMATTER to a wxWidgets wxOutputStream. More...

Inheritance diagram for numEval::STREAM_OUTPUTFORMATTER:
numEval::OUTPUTFORMATTER

Public Member Functions

 STREAM_OUTPUTFORMATTER (wxOutputStream &aStream, char aQuoteChar= '"' )
 Constructor STREAM_OUTPUTFORMATTER can take any number of wxOutputStream derivations, so it can write to a file, socket, or zip file. More...
 
virtual const char * GetQuoteChar (const char *wrapee)
 Function GetQuoteChar performs quote character need determination. More...
 
int PRINTF_FUNC Print (int nestLevel, const char *fmt,...)
 Function Print formats and writes text to the output stream. More...
 
virtual std::string Quotes (const std::string &aWrapee)
 Function Quotes checks aWrapee input string for a need to be quoted (e.g. More...
 
std::string Quotew (const wxString &aWrapee)
 

Protected Member Functions

void write (const char *aOutBuf, int aCount) override
 Function write should be coded in the interface implementation (derived) classes. More...
 

Static Protected Member Functions

static const char * GetQuoteChar (const char *wrapee, const char *quote_char)
 Function GetQuoteChar performs quote character need determination according to the Specctra DSN specification. More...
 

Private Attributes

wxOutputStream & m_os
 

Detailed Description

Class STREAM_OUTPUTFORMATTER implements OUTPUTFORMATTER to a wxWidgets wxOutputStream.

The stream is neither opened nor closed by this class.

Definition at line 526 of file numeric_evaluator.cpp.

Constructor & Destructor Documentation

numEval::STREAM_OUTPUTFORMATTER::STREAM_OUTPUTFORMATTER ( wxOutputStream &  aStream,
char  aQuoteChar = '"' 
)
inline

Constructor STREAM_OUTPUTFORMATTER can take any number of wxOutputStream derivations, so it can write to a file, socket, or zip file.

Definition at line 536 of file numeric_evaluator.cpp.

Member Function Documentation

static const char* numEval::OUTPUTFORMATTER::GetQuoteChar ( const char *  wrapee,
const char *  quote_char 
)
staticprotectedinherited

Function GetQuoteChar performs quote character need determination according to the Specctra DSN specification.

Parameters
wrapeeA string that might need wrapping on each end.
quote_charA single character C string which provides the current quote character, should it be needed by the wrapee.
Returns
const char* - the quote_char as a single character string, or "" if the wrapee does not need to be wrapped.
virtual const char* numEval::OUTPUTFORMATTER::GetQuoteChar ( const char *  wrapee)
virtualinherited

Function GetQuoteChar performs quote character need determination.

It returns the quote character as a single character string for a given input wrapee string. If the wrappee does not need to be quoted, the return value is "" (the null string), such as when there are no delimiters in the input wrapee string. If you want the quote_char to be assuredly not "", then pass in "(" as the wrappee.

Implementations are free to override the default behavior, which is to call the static function of the same name.

Parameters
wrapeeA string that might need wrapping on each end.
Returns
const char* - the quote_char as a single character string, or "" if the wrapee does not need to be wrapped.
int PRINTF_FUNC numEval::OUTPUTFORMATTER::Print ( int  nestLevel,
const char *  fmt,
  ... 
)
inherited

Function Print formats and writes text to the output stream.

Parameters
nestLevelThe multiple of spaces to precede the output with.
fmtA printf() style format string.
...a variable list of parameters that will get blended into the output under control of the format string.
Returns
int - the number of characters output.
Exceptions
IO_ERROR,ifthere is a problem outputting, such as a full disk.
virtual std::string numEval::OUTPUTFORMATTER::Quotes ( const std::string &  aWrapee)
virtualinherited

Function Quotes checks aWrapee input string for a need to be quoted (e.g.

contains a ')' character or a space), and for " double quotes within the string that need to be escaped such that the DSNLEXER will correctly parse the string from a file later.

Parameters
aWrapeeis a string that might need wraping in double quotes, and it might need to have its internal content escaped, or not.
Returns
std::string - whose c_str() function can be called for passing to printf() style functions that output UTF8 encoded s-expression streams.
Exceptions
IO_ERROR,ifthere is any kind of problem with the input string.
std::string numEval::OUTPUTFORMATTER::Quotew ( const wxString &  aWrapee)
inherited
void numEval::STREAM_OUTPUTFORMATTER::write ( const char *  aOutBuf,
int  aCount 
)
overrideprotectedvirtual

Function write should be coded in the interface implementation (derived) classes.

Parameters
aOutBufis the start of a byte buffer to write.
aCounttells how many bytes to write.
Exceptions
IO_ERROR,ifthere is a problem outputting, such as a full disk.

Implements numEval::OUTPUTFORMATTER.

Member Data Documentation

wxOutputStream& numEval::STREAM_OUTPUTFORMATTER::m_os
private

Definition at line 528 of file numeric_evaluator.cpp.


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