IGLib 1.4
The IGLib base library for development of numerical, technical and business applications.
|
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...
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. |
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.
bool IG::Lib::IReporterTextWriter::SetTextWriter | ( | TextWriter | writer | ) |
Sets the text writer to which reporting is also performed.
writer | Textwriter to which reporting will be performed. |
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.
writer | Textwriter to which reporting will be performed. |
writeintro | Overrides 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. |
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.
writer | Textwriter to which reporting will be performed. |
writeintro | Overrides 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. |
disposewriter | Indicates whether the TextWriter should be disposed when not used any more. Default is false when specifying a textwriter. |
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.
writer | Stream to which reporting will be performed. |
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.
writer | Textwriter to which reporting will be performed. |
writeintro | Overrides 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. |
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.
writer | Textwriter to which reporting will be performed. |
writeintro | Overrides 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. |
disposewriter | Indicates whether the TextWriter should be disposed when not used any more. Default is false when specifying a stream. |
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.
filename | Name of the file to which reporting will be performed. |
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.
filename | Name of the file to which reporting will be performed. |
append | If false then eventual existing contents of the file are overwritten. Otherwise, new text is appended at the end of the file. |
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.
filename | Name of the file to which reporting will be performed. |
append | If false then eventual existing contents of the file are overwritten. Otherwise, new text is appended at the end of the file. |
writeintro | Overrides 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. |
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.
filename | Name of the file to which reporting will be performed. |
append | If false then eventual existing contents of the file are overwritten. Otherwise, new text is appended at the end of the file. |
writeintro | Overrides 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. |
disposewriter | Indicates whether the TextWriter should be disposed when not used any more. Default is true when specifying a file name. |
Implemented in IG::Lib::ReporterBase.
bool IG::Lib::IReporterTextWriter::AddTextWriter | ( | TextWriter | writer | ) |
Sets the text writer to which reporting is also performed.
writer | Textwriter to which reporting will be performed. |
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.
writer | Textwriter to which reporting will be performed. |
writeintro | Overrides 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. |
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.
writer | Textwriter to which reporting will be performed. |
writeintro | Overrides 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. |
disposewriter | Indicates whether the TextWriter should be disposed when not used any more. Default is false when specifying a textwriter. |
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.
writer | Stream to which reporting will be performed. |
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.
writer | Textwriter to which reporting will be performed. |
writeintro | Overrides 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. |
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.
writer | Textwriter to which reporting will be performed. |
writeintro | Overrides 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. |
disposewriter | Indicates whether the TextWriter should be disposed when not used any more. Default is false when specifying a stream. |
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.
filename | Name of the file to which reporting will be performed. |
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.
filename | Name of the file to which reporting will be performed. |
append | If false then eventual existing contents of the file are overwritten. Otherwise, new text is appended at the end of the file. |
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.
filename | Name of the file to which reporting will be performed. |
append | If false then eventual existing contents of the file are overwritten. Otherwise, new text is appended at the end of the file. |
writeintro | Overrides 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. |
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.
filename | Name of the file to which reporting will be performed. |
append | If false then eventual existing contents of the file are overwritten. Otherwise, new text is appended at the end of the file. |
writeintro | Overrides 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. |
disposewriter | Indicates whether the TextWriter should be disposed when not used any more. Default is true when specifying a file name. |
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.
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.
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.
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.
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.
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.
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).
writableonly | If true then only those text writers are listed that are actually writable. If false then all text writers are listed. |
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.
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.
writableonly | If true then only those text writers are counted that are actually writable. If false then all text writers are returned. |
Implemented in IG::Lib::ReporterBase.
int IG::Lib::IReporterTextWriter::TextWriterFlush | ( | ) |
Flushes all text writers of the Writer's TextWriter subsystem.
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.
str | String to be written. |
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.
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.