23 m_fileName(), m_file(), m_maxFileSize(0), m_openFile(false), m_currentFileSize(0)
71 status = (writeSize > 0);
101 bool failedSuffix =
false;
105 if (suffix >= maxBackups) {
110 formatStatus = searchFilename.
format(
"%s%" PRIu32, fileName, suffix);
119 searchFilename = fileName;
Os::FileInterface::Status open(const char *path, Mode mode)
open file with supplied path and mode
const char * toChar() const
Do wait for read/write operation to finish.
void close() override
close the file, if not opened then do nothing
FormatStatus format(const CHAR *formatString,...)
write formatted string to buffer
bool set_log_file(const char *fileName, const U32 maxSize, const U32 maxBackups=10)
Set log file and max size.
file hasn't been opened yet
Operation was successful.
PlatformSignedSizeType FwSignedSizeType
static Status getFileSize(const char *path, FwSignedSizeType &size)
Get the size of the file (in bytes) at the specified path.
Operation was successful.
bool write_to_log(const char *const buf, const U32 size)
Write the passed buf to the log if possible.
Status write(const U8 *buffer, FwSignedSizeType &size)
write data to this file from the supplied buffer bounded by size
Fw::FileNameString m_fileName
FormatStatus
status of string format calls
Open file for writing and truncates file if it exists, ie same flags as creat()