41#ifndef _DWMFILEROLLER_HH_
42#define _DWMFILEROLLER_HH_
80 const std::string & prefix,
81 size_t maxSize,
size_t numFiles,
157 bool GzipFile(
const std::string & src,
const std::string & dst)
const;
158 bool BzipFile(
const std::string & src,
const std::string & dst)
const;
159 bool GetFilename(
size_t fileNum, std::string & filename)
const;
This class can be used to roll over files such as log files.
Definition DwmFileRoller.hh:59
CompressionEnum
Available compression types.
Definition DwmFileRoller.hh:64
bool FilesNeedRolling(FILE *f) const
Returns true if the current write position of f is larger than our maximum file size (set with maxSiz...
FileRoller(const std::string &dir, const std::string &prefix, size_t maxSize, size_t numFiles, CompressionEnum compression=e_compressionNone)
Constructor.
bool FilesNeedRolling(int fd) const
Returns true if the current write position of fd is larger than our maximum file size (set with maxSi...
size_t MaxSize() const
Returns the max file size.
size_t NumFiles(size_t numFiles)
Sets and returns the max file size.
size_t NumFiles() const
Returns the max file size.
size_t MaxSize(size_t maxSize)
Sets and returns the max file size.
bool FilesNeedRolling(std::ostream &os) const
Returns true if the current write position of os is larger than our maximum file size (set with maxSi...
bool FilesNeedRolling() const
Returns true if the active file (identified by the dir and prefix in the call to our constructor) is ...
bool RollFiles()
Rolls the files.