IGLib 1.4
The IGLib base library for development of numerical, technical and business applications.

IG::Lib::IReporterTextWriter Interface Reference

Reporters that utilize writing messages to files. Messages are typically formatted as multi-line messages with distinctive markup. For one-line possibly indented messages, IReporterTextLogger should be used. More...

Inheritance diagram for IG::Lib::IReporterTextWriter:
Collaboration diagram for IG::Lib::IReporterTextWriter:

List of all members.

Public Member Functions

bool SetTextWriter (TextWriter writer)
 Sets the text writer to which reporting is also performed.
bool SetTextWriter (TextWriter writer, bool writeintro)
 Sets the basic text writer to which reporting is performed, but overrides the writeintro property by the 'writeintro' argument.
bool SetTextWriter (TextWriter writer, bool writeintro, bool disposewriter)
 Sets the basic text writer to which reporting is performed, but overrides the writeintro property by the 'writeintro' argument.
bool SetTextWriter (Stream stream)
 Creates a TextWriter upon the stream and sets it as the text writer to which reporting is also performed.
bool SetTextWriter (Stream stream, bool writeintro)
 Creates a TextWriter upon the stream and sets it as the basic TextWriter to which reporting is performed. Overrides the writeintro property by the 'writeintro' argument.
bool SetTextWriter (Stream stream, bool writeintro, bool disposewriter)
 Creates a TextWriter upon the stream and sets it as the basic TextWriter to which reporting is performed. Overrides the writeintro property by the 'writeintro' argument.
bool SetTextWriter (string filename)
 Creates a TextWriter upon a file and sets it as the basic TextWriter to which reporting is also performed. The file is overwritten.
bool SetTextWriter (string filename, bool append)
 Creates a TextWriter upon a file and sets it as the basic TextWriter to which reporting is also performed, where the caller specifies either to overwrite the file or to append to it.
bool SetTextWriter (string filename, bool append, bool writeintro)
 Creates a TextWriter upon a file and sets it as the text writer to which reporting is also performed. The caller specifies whether to overwrite the file or to append to it, and whether the introductory text is written before reporting to the file begins.
bool SetTextWriter (string filename, bool append, bool writeintro, bool disposewriter)
 Creates a TextWriter upon a file and sets it as the text writer to which reporting is also performed. The caller specifies whether to overwrite the file or to append to it, and whether the introductory text is written before reporting to the file begins.
bool AddTextWriter (TextWriter writer)
 Sets the text writer to which reporting is also performed.
bool AddTextWriter (TextWriter writer, bool writeintro)
 Sets the basic text writer to which reporting is performed, but overrides the writeintro property by the 'writeintro' argument.
bool AddTextWriter (TextWriter writer, bool writeintro, bool disposewriter)
 Sets the basic text writer to which reporting is performed, but overrides the writeintro property by the 'writeintro' argument.
bool AddTextWriter (Stream stream)
 Creates a TextWriter from the stream and adds it to the list of TextWriters on which reporting is also performed.
bool AddTextWriter (Stream stream, bool writeintro)
 Creates a TextWriter from the stream and adds it to the list of TextWriters on which reporting is also performed. Overrides the writeintro property by the 'writeintro' argument.
bool AddTextWriter (Stream stream, bool writeintro, bool disposewriter)
 Creates a TextWriter from the stream and adds it to the list of TextWriters on which reporting is also performed. Overrides the writeintro property by the 'writeintro' argument.
bool AddTextWriter (string filename)
 Creates a TextWriter from the file name and adds it to the list of TextWriters on which reporting is also performed. The file is overwritten.
bool AddTextWriter (string filename, bool append)
 Creates a TextWriter from the stream and adds it to the list of TextWriters on which reporting is also performed. The caller specifies either to overwrite the file or to append to it.
bool AddTextWriter (string filename, bool append, bool writeintro)
 Creates a TextWriter from the stream and adds it to the list of TextWriters on which reporting is also performed. The caller specifies whether to overwrite the file or to append to it, and whether the introductory text is written before reporting to the file begins.
bool AddTextWriter (string filename, bool append, bool writeintro, bool disposewriter)
 Creates a TextWriter from the stream and adds it to the list of TextWriters on which reporting is also performed. The caller specifies whether to overwrite the file or to append to it, and whether the introductory text is written before reporting to the file begins.
bool RemoveTextWriters ()
 Removes all text writers from the TextWriter subsystem. If appropriate, the corresponding text writer is closed.
bool RemoveTextWriter ()
 Removes the default text writer from the TextWriter subsystem. If appropriate, the corresponding text writer is closed.
bool RemoveTextWriter (TextWriter writer)
 Removes the first object from Writers that contains the specified TextWriter. If appropriate, the corresponding text writer is closed.
bool RemoveTextWriter (Stream stream)
 Removes the first object from Writers whose TextWriter has been created form the specified stream. If appropriate, the corresponding text writer is closed.
bool RemoveTextWriter (string filename)
 Removes the first object from Writers whose TextWriter has been created form the file with the specified name. If appropriate, the corresponding text writer is closed.
List< TextWriter > TextWriterWriters ()
 Returns a list of all text writers that are currently used by the reporter's text writer. Only text writers that are actually writable are included.
List< TextWriter > TextWriterWriters (bool writableonly)
 Returns a list of all text writers that are currently used by the reporter's text writer. Warning: Beware of thread safety issues! Blocks of code where the returned list is used should be enclosed in lock(reporter.lockobj){...} block (where reporter is the object through which this method was called).
int TextWriterNumWriters ()
 Returns the current number of text writers used by the reporter's text logging module. Only text writers that are actually writable are counted.
int TextWriterNumWriters (bool writableonly)
 Returns the current number of TextWriters used by the reporter's text logging module.
int TextWriterFlush ()
 Flushes all text writers of the Writer's TextWriter subsystem.
int TextWriterWrite (string str)
 Writes a string to all text writers of the Writer's TextWriter subsystem.
int TextWriterWriteLine (string str)
 Similar to TextWriterWrite(), except that a newline is added at the end of the string.

Properties

bool UseTextWriter [get, set]
 Specifies whether or not TextWriter(s) are used by the Reporter to log messages.
string TextWriterIntroText [get, set]
 Gets or sets the introduction string that is written before logging to a TextWriter begins. If this is not specified then the reporter composes its own introduction string, eventually using programname (when defined).
string TextWriterProgramName [get, set]
 String denoting the name of the program or other entity that uses the Reporter for logging. When introtext is not specified, this name is used in the introduction text composed by the reporter.
bool TextWriterWriteIntro [get, set]
 Specifies whether introduction text is written before logging of messages begins or not.

Detailed Description

Reporters that utilize writing messages to files. Messages are typically formatted as multi-line messages with distinctive markup. For one-line possibly indented messages, IReporterTextLogger should be used.


Member Function Documentation

bool IG::Lib::IReporterTextWriter::SetTextWriter ( TextWriter  writer)

Sets the text writer to which reporting is also performed.

Parameters:
writerTextwriter to which reporting will be performed.
Returns:
True if a new writer has been successfully set and is ready to use, false otherwise.

Implemented in IG::Lib::ReporterBase.

bool IG::Lib::IReporterTextWriter::SetTextWriter ( TextWriter  writer,
bool  writeintro 
)

Sets the basic text writer to which reporting is performed, but overrides the writeintro property by the 'writeintro' argument.

Parameters:
writerTextwriter to which reporting will be performed.
writeintroOverrides the class' writeintro property (if true then introductory text is printed, regardless of the value of the property). If the introductory text is printed then the standard method is used, taking into account the introtext and programname properties.
Returns:
True if a new writer has been successfully set and is ready to use, false otherwise.

Implemented in IG::Lib::ReporterBase.

bool IG::Lib::IReporterTextWriter::SetTextWriter ( TextWriter  writer,
bool  writeintro,
bool  disposewriter 
)

Sets the basic text writer to which reporting is performed, but overrides the writeintro property by the 'writeintro' argument.

Parameters:
writerTextwriter to which reporting will be performed.
writeintroOverrides the class' writeintro property (if true then introductory text is printed, regardless of the value of the property). If the introductory text is printed then the standard method is used, taking into account the introtext and programname properties.
disposewriterIndicates whether the TextWriter should be disposed when not used any more. Default is false when specifying a textwriter.
Returns:
True if a new writer has been successfully set and is ready to use, false otherwise.

Implemented in IG::Lib::ReporterBase.

bool IG::Lib::IReporterTextWriter::SetTextWriter ( Stream  stream)

Creates a TextWriter upon the stream and sets it as the text writer to which reporting is also performed.

Parameters:
writerStream to which reporting will be performed.
Returns:
True if a new writer has been successfully set and is ready to use, false otherwise.

Implemented in IG::Lib::ReporterBase.

bool IG::Lib::IReporterTextWriter::SetTextWriter ( Stream  stream,
bool  writeintro 
)

Creates a TextWriter upon the stream and sets it as the basic TextWriter to which reporting is performed. Overrides the writeintro property by the 'writeintro' argument.

Parameters:
writerTextwriter to which reporting will be performed.
writeintroOverrides the class' writeintro property (if true then introductory text is printed, regardless of the value of the property). If the introductory text is printed then the standard method is used, taking into account the introtext and programname properties.
Returns:
True if a new writer has been successfully set and is ready to use, false otherwise.

Implemented in IG::Lib::ReporterBase.

bool IG::Lib::IReporterTextWriter::SetTextWriter ( Stream  stream,
bool  writeintro,
bool  disposewriter 
)

Creates a TextWriter upon the stream and sets it as the basic TextWriter to which reporting is performed. Overrides the writeintro property by the 'writeintro' argument.

Parameters:
writerTextwriter to which reporting will be performed.
writeintroOverrides the class' writeintro property (if true then introductory text is printed, regardless of the value of the property). If the introductory text is printed then the standard method is used, taking into account the introtext and programname properties.
disposewriterIndicates whether the TextWriter should be disposed when not used any more. Default is false when specifying a stream.
Returns:
True if a new writer has been successfully set and is ready to use, false otherwise.

Implemented in IG::Lib::ReporterBase.

bool IG::Lib::IReporterTextWriter::SetTextWriter ( string  filename)

Creates a TextWriter upon a file and sets it as the basic TextWriter to which reporting is also performed. The file is overwritten.

Parameters:
filenameName of the file to which reporting will be performed.
Returns:
True if a new writer has been successfully set and is ready to use, false otherwise.

Implemented in IG::Lib::ReporterBase.

bool IG::Lib::IReporterTextWriter::SetTextWriter ( string  filename,
bool  append 
)

Creates a TextWriter upon a file and sets it as the basic TextWriter to which reporting is also performed, where the caller specifies either to overwrite the file or to append to it.

Parameters:
filenameName of the file to which reporting will be performed.
appendIf false then eventual existing contents of the file are overwritten. Otherwise, new text is appended at the end of the file.
Returns:
True if a new writer has been successfully set and is ready to use, false otherwise.

Implemented in IG::Lib::ReporterBase.

bool IG::Lib::IReporterTextWriter::SetTextWriter ( string  filename,
bool  append,
bool  writeintro 
)

Creates a TextWriter upon a file and sets it as the text writer to which reporting is also performed. The caller specifies whether to overwrite the file or to append to it, and whether the introductory text is written before reporting to the file begins.

Parameters:
filenameName of the file to which reporting will be performed.
appendIf false then eventual existing contents of the file are overwritten. Otherwise, new text is appended at the end of the file.
writeintroOverrides the class' writeintro property (if true then introductory text is printed, regardless of the value of the property). If the introductory text is printed then the standard method is used, taking into account the introtext and programname properties.
Returns:
True if a new writer has been successfully set and is ready to use, false otherwise.

Implemented in IG::Lib::ReporterBase.

bool IG::Lib::IReporterTextWriter::SetTextWriter ( string  filename,
bool  append,
bool  writeintro,
bool  disposewriter 
)

Creates a TextWriter upon a file and sets it as the text writer to which reporting is also performed. The caller specifies whether to overwrite the file or to append to it, and whether the introductory text is written before reporting to the file begins.

Parameters:
filenameName of the file to which reporting will be performed.
appendIf false then eventual existing contents of the file are overwritten. Otherwise, new text is appended at the end of the file.
writeintroOverrides the class' writeintro property (if true then introductory text is printed, regardless of the value of the property). If the introductory text is printed then the standard method is used, taking into account the introtext and programname properties.
disposewriterIndicates whether the TextWriter should be disposed when not used any more. Default is true when specifying a file name.
Returns:
True if a new writer has been successfully set and is ready to use, false otherwise.

Implemented in IG::Lib::ReporterBase.

bool IG::Lib::IReporterTextWriter::AddTextWriter ( TextWriter  writer)

Sets the text writer to which reporting is also performed.

Parameters:
writerTextwriter to which reporting will be performed.
Returns:
True if a new writer has been successfully set and is ready to use, false otherwise.

Implemented in IG::Lib::ReporterBase.

bool IG::Lib::IReporterTextWriter::AddTextWriter ( TextWriter  writer,
bool  writeintro 
)

Sets the basic text writer to which reporting is performed, but overrides the writeintro property by the 'writeintro' argument.

Parameters:
writerTextwriter to which reporting will be performed.
writeintroOverrides the class' writeintro property (if true then introductory text is printed, regardless of the value of the property). If the introductory text is printed then the standard method is used, taking into account the introtext and programname properties.
Returns:
True if a new writer has been successfully set and is ready to use, false otherwise.

Implemented in IG::Lib::ReporterBase.

bool IG::Lib::IReporterTextWriter::AddTextWriter ( TextWriter  writer,
bool  writeintro,
bool  disposewriter 
)

Sets the basic text writer to which reporting is performed, but overrides the writeintro property by the 'writeintro' argument.

Parameters:
writerTextwriter to which reporting will be performed.
writeintroOverrides the class' writeintro property (if true then introductory text is printed, regardless of the value of the property). If the introductory text is printed then the standard method is used, taking into account the introtext and programname properties.
disposewriterIndicates whether the TextWriter should be disposed when not used any more. Default is false when specifying a textwriter.
Returns:
True if a new writer has been successfully set and is ready to use, false otherwise.

Implemented in IG::Lib::ReporterBase.

bool IG::Lib::IReporterTextWriter::AddTextWriter ( Stream  stream)

Creates a TextWriter from the stream and adds it to the list of TextWriters on which reporting is also performed.

Parameters:
writerStream to which reporting will be performed.
Returns:
True if a new writer has been successfully set and is ready to use, false otherwise.

Implemented in IG::Lib::ReporterBase.

bool IG::Lib::IReporterTextWriter::AddTextWriter ( Stream  stream,
bool  writeintro 
)

Creates a TextWriter from the stream and adds it to the list of TextWriters on which reporting is also performed. Overrides the writeintro property by the 'writeintro' argument.

Parameters:
writerTextwriter to which reporting will be performed.
writeintroOverrides the class' writeintro property (if true then introductory text is printed, regardless of the value of the property). If the introductory text is printed then the standard method is used, taking into account the introtext and programname properties.
Returns:
True if a new writer has been successfully set and is ready to use, false otherwise.

Implemented in IG::Lib::ReporterBase.

bool IG::Lib::IReporterTextWriter::AddTextWriter ( Stream  stream,
bool  writeintro,
bool  disposewriter 
)

Creates a TextWriter from the stream and adds it to the list of TextWriters on which reporting is also performed. Overrides the writeintro property by the 'writeintro' argument.

Parameters:
writerTextwriter to which reporting will be performed.
writeintroOverrides the class' writeintro property (if true then introductory text is printed, regardless of the value of the property). If the introductory text is printed then the standard method is used, taking into account the introtext and programname properties.
disposewriterIndicates whether the TextWriter should be disposed when not used any more. Default is false when specifying a stream.
Returns:
True if a new writer has been successfully set and is ready to use, false otherwise.

Implemented in IG::Lib::ReporterBase.

bool IG::Lib::IReporterTextWriter::AddTextWriter ( string  filename)

Creates a TextWriter from the file name and adds it to the list of TextWriters on which reporting is also performed. The file is overwritten.

Parameters:
filenameName of the file to which reporting will be performed.
Returns:
True if a new writer has been successfully set and is ready to use, false otherwise.

Implemented in IG::Lib::ReporterBase.

bool IG::Lib::IReporterTextWriter::AddTextWriter ( string  filename,
bool  append 
)

Creates a TextWriter from the stream and adds it to the list of TextWriters on which reporting is also performed. The caller specifies either to overwrite the file or to append to it.

Parameters:
filenameName of the file to which reporting will be performed.
appendIf false then eventual existing contents of the file are overwritten. Otherwise, new text is appended at the end of the file.
Returns:
True if a new writer has been successfully set and is ready to use, false otherwise.

Implemented in IG::Lib::ReporterBase.

bool IG::Lib::IReporterTextWriter::AddTextWriter ( string  filename,
bool  append,
bool  writeintro 
)

Creates a TextWriter from the stream and adds it to the list of TextWriters on which reporting is also performed. The caller specifies whether to overwrite the file or to append to it, and whether the introductory text is written before reporting to the file begins.

Parameters:
filenameName of the file to which reporting will be performed.
appendIf false then eventual existing contents of the file are overwritten. Otherwise, new text is appended at the end of the file.
writeintroOverrides the class' writeintro property (if true then introductory text is printed, regardless of the value of the property). If the introductory text is printed then the standard method is used, taking into account the introtext and programname properties.
Returns:
True if a new writer has been successfully set and is ready to use, false otherwise.

Implemented in IG::Lib::ReporterBase.

bool IG::Lib::IReporterTextWriter::AddTextWriter ( string  filename,
bool  append,
bool  writeintro,
bool  disposewriter 
)

Creates a TextWriter from the stream and adds it to the list of TextWriters on which reporting is also performed. The caller specifies whether to overwrite the file or to append to it, and whether the introductory text is written before reporting to the file begins.

Parameters:
filenameName of the file to which reporting will be performed.
appendIf false then eventual existing contents of the file are overwritten. Otherwise, new text is appended at the end of the file.
writeintroOverrides the class' writeintro property (if true then introductory text is printed, regardless of the value of the property). If the introductory text is printed then the standard method is used, taking into account the introtext and programname properties.
disposewriterIndicates whether the TextWriter should be disposed when not used any more. Default is true when specifying a file name.
Returns:
True if a new writer has been successfully set and is ready to use, false otherwise.

Implemented in IG::Lib::ReporterBase.

bool IG::Lib::IReporterTextWriter::RemoveTextWriters ( )

Removes all text writers from the TextWriter subsystem. If appropriate, the corresponding text writer is closed.

Returns:
true if al text writers were successfully removed, false if there were problems.

Implemented in IG::Lib::ReporterBase.

bool IG::Lib::IReporterTextWriter::RemoveTextWriter ( )

Removes the default text writer from the TextWriter subsystem. If appropriate, the corresponding text writer is closed.

Returns:
true if the text writer was successfully removed, false otherwise (also if there is no writer installed)

Implemented in IG::Lib::ReporterBase.

bool IG::Lib::IReporterTextWriter::RemoveTextWriter ( TextWriter  writer)

Removes the first object from Writers that contains the specified TextWriter. If appropriate, the corresponding text writer is closed.

Returns:
true if the text writer was successfully removed, false otherwise (also if there is no writer installed corresponding the argument)

Implemented in IG::Lib::ReporterBase.

bool IG::Lib::IReporterTextWriter::RemoveTextWriter ( Stream  stream)

Removes the first object from Writers whose TextWriter has been created form the specified stream. If appropriate, the corresponding text writer is closed.

Returns:
true if the text writer was successfully removed, false otherwise (also if there is no writer installed corresponding the argument)

Implemented in IG::Lib::ReporterBase.

bool IG::Lib::IReporterTextWriter::RemoveTextWriter ( string  filename)

Removes the first object from Writers whose TextWriter has been created form the file with the specified name. If appropriate, the corresponding text writer is closed.

Returns:
true if the text writer was successfully removed, false otherwise (also if there is no writer installed corresponding the argument)

Implemented in IG::Lib::ReporterBase.

List<TextWriter> IG::Lib::IReporterTextWriter::TextWriterWriters ( )

Returns a list of all text writers that are currently used by the reporter's text writer. Only text writers that are actually writable are included.

Returns:
List of text writers that are currently used by the reporter's text writer (only those that are actually writable are included).

Implemented in IG::Lib::ReporterBase.

List<TextWriter> IG::Lib::IReporterTextWriter::TextWriterWriters ( bool  writableonly)

Returns a list of all text writers that are currently used by the reporter's text writer. Warning: Beware of thread safety issues! Blocks of code where the returned list is used should be enclosed in lock(reporter.lockobj){...} block (where reporter is the object through which this method was called).

Parameters:
writableonlyIf true then only those text writers are listed that are actually writable. If false then all text writers are listed.
Returns:
List of text writers that are currently used by the reporter's text writer.

Implemented in IG::Lib::ReporterBase.

int IG::Lib::IReporterTextWriter::TextWriterNumWriters ( )

Returns the current number of text writers used by the reporter's text logging module. Only text writers that are actually writable are counted.

Returns:
The current number of text writers used by the reporter's text logging module (only those that are actually writable are counted).

Implemented in IG::Lib::ReporterBase.

int IG::Lib::IReporterTextWriter::TextWriterNumWriters ( bool  writableonly)

Returns the current number of TextWriters used by the reporter's text logging module.

Parameters:
writableonlyIf true then only those text writers are counted that are actually writable. If false then all text writers are returned.
Returns:
The current number of text writers used by the reporter's text logging module.

Implemented in IG::Lib::ReporterBase.

int IG::Lib::IReporterTextWriter::TextWriterFlush ( )

Flushes all text writers of the Writer's TextWriter subsystem.

Returns:
Number of writers that has actually been flushed.

Implemented in IG::Lib::ReporterBase.

int IG::Lib::IReporterTextWriter::TextWriterWrite ( string  str)

Writes a string to all text writers of the Writer's TextWriter subsystem.

Parameters:
strString to be written.
Returns:
Number of writers that the string has actually been written to.

Implemented in IG::Lib::ReporterBase.

int IG::Lib::IReporterTextWriter::TextWriterWriteLine ( string  str)

Similar to TextWriterWrite(), except that a newline is added at the end of the string.

Implemented in IG::Lib::ReporterBase.


Property Documentation

bool IG::Lib::IReporterTextWriter::UseTextWriter [get, set]

Specifies whether or not TextWriter(s) are used by the Reporter to log messages.

Implemented in IG::Lib::ReporterBase.

string IG::Lib::IReporterTextWriter::TextWriterIntroText [get, set]

Gets or sets the introduction string that is written before logging to a TextWriter begins. If this is not specified then the reporter composes its own introduction string, eventually using programname (when defined).

Implemented in IG::Lib::ReporterBase.

string IG::Lib::IReporterTextWriter::TextWriterProgramName [get, set]

String denoting the name of the program or other entity that uses the Reporter for logging. When introtext is not specified, this name is used in the introduction text composed by the reporter.

Implemented in IG::Lib::ReporterBase.

bool IG::Lib::IReporterTextWriter::TextWriterWriteIntro [get, set]

Specifies whether introduction text is written before logging of messages begins or not.

Implemented in IG::Lib::ReporterBase.


The documentation for this interface was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties Events