23 m_fileName(), m_file(), m_maxFileSize(0), m_openFile(false), m_currentFileSize(0)
71 status = (writeSize > 0);
100 (void) strncpy(fileNameFinal,fileName,
106 bool failedSuffix =
false;
116 if (suffix >= maxBackups) {
122 "%s%" PRIu32,fileName,suffix);
137 (void) strncpy(fileNameFinal,fileName,
PlatformIntType NATIVE_INT_TYPE
PlatformSizeType FwSizeType
@ STRING_SIZE
Storage for string.
@ NOT_OPENED
file hasn't been opened yet
@ OP_OK
Operation was successful.
Status write(const void *buffer, NATIVE_INT_TYPE &size, bool waitForDone=true)
write size; will return amount written or errno
@ OPEN_CREATE
Open file for writing and truncates file if it exists, ie same flags as creat()
Status open(const char *fileName, Mode mode)
open file. Writing creates file if it doesn't exist
U32 string_length(const CHAR *source, U32 max_len)
get the length of the source string or max_len if the string is longer than max_len.
Status getFileSize(const char *path, FwSizeType &size)
append file origin to destination file. If boolean true, creates a brand new file if the destination ...
@ OP_OK
Operation was successful.
bool set_log_file(const char *fileName, const U32 maxSize, const U32 maxBackups=10)
Set log file and max size.
bool write_to_log(const char *const buf, const U32 size)
Write the passed buf to the log if possible.