10 #ifndef FILELOGWRITER_H_
11 #define FILELOGWRITER_H_
104 bool open(
const char *filename,
const bool append );
FileOutStream fileStream_
The output file stream.
Definition: FileLogWriter.h:133
unsigned int bytesInFile_
Total bytes written.
Definition: FileLogWriter.h:139
Wraps around another LogWriter to write LogEntries to a file.
Definition: FileLogWriter.h:28
FileLogWriter(const Str &filename, LogWriter *logWriter, const bool append=false, FileEncoder *fileEncoder=NULL)
Constructor with filename & specified flushFreq.
Definition: FileLogWriter.cpp:28
Definition: FileLogWriter.h:33
Base class for a generalized set of "log data destinations," including to files (text or binary)...
Definition: LogWriter.h:25
Contains the LogWriter class definition.
void resetFilename(const Str &filename)
Definition: FileLogWriter.cpp:208
FileEncoder * getFileEncoder()
Definition: FileLogWriter.h:114
Definition: FileLogWriter.h:33
Str filename_
Name of the current file.
Definition: FileLogWriter.h:145
unsigned int getBytesInFile(void)
Accessors.
Definition: FileLogWriter.h:73
FlushFreq
Definition: FileLogWriter.h:31
virtual const Str & getFilename()
Definition: FileLogWriter.h:85
FileEncoder * fileEncoder_
Definition: FileLogWriter.h:151
Wraps a c FILE* handle with an OutStream class.
Definition: FileOutStream.h:26
Definition: FileLogWriter.h:33
bool isWritable(void)
Keep track of whether the stream is open.
Definition: FileLogWriter.h:93
One "entry" in a LogQueue.
Definition: LogEntry.h:33
unsigned int entriesWritten_
Total entries written.
Definition: FileLogWriter.h:136
Replacement for standard template class string.
Definition: Str.h:12
FlushFreq flushFreq_
Definition: FileLogWriter.h:147
virtual ~FileLogWriter()
Destructor, closes file if open.
Definition: FileLogWriter.cpp:70
bool writtenInCycle_
Definition: FileLogWriter.h:149
bool isWritable()
indicates whether the stream can actually be written to.
Definition: FileOutStream.h:63
Simple Interface that contains getFilename() function.
virtual void endCycle()
If flushFreq_ is FLUSH_PER_CYCLE, this causes an output flush.
Definition: FileLogWriter.cpp:185
void setFlushFreq(const FlushFreq flushFreq)
Definition: FileLogWriter.h:109
bool initFilename_
True if a file name is specified in constructor.
Definition: FileLogWriter.h:142
void setFilename(const Str &filename)
Definition: FileLogWriter.h:119
virtual bool valid(void)
Is the LogWriter valid?
Definition: FileLogWriter.h:60
virtual unsigned int write(const LogEntry *entry, const Unit *unit=NULL)
Write.
Definition: FileLogWriter.cpp:159
Simple Interface that contains getFilename() function.
Definition: HasFilename.h:20
virtual void resetInputs()
Reset cached input settings.
Definition: FileLogWriter.cpp:88
This is a rather abstract class that can be implemented by classes that encode a (closed) file...
Definition: FileEncoder.h:20
unsigned int getEntriesWritten(void)
Definition: FileLogWriter.h:79
Code that represents an engineering unit.
Definition: Unit.h:24
LogWriter * logWriter_
The LogWriter that does the actual writing.
Definition: FileLogWriter.h:125
void close(void)
Close the currently open file.
Definition: FileLogWriter.cpp:140
Contains the FileOutStream class declaration.
bool open(const char *filename, const bool append)
Open the stream to the named file.
Definition: FileLogWriter.cpp:100