class Poco::PurgeStrategy

Overview

The PurgeStrategy is used by FileChannel to purge archived log files. More…

#include <PurgeStrategy.h>

class PurgeStrategy
{
public:
    // methods

    virtual
    void
    purge(const std::string& path) = 0;

protected:
    // methods

    void
    list(
        const std::string& path,
        std::vector<File>& files
        );
};

// direct descendants

class PurgeByAgeStrategy;
class PurgeByCountStrategy;

Detailed Documentation

The PurgeStrategy is used by FileChannel to purge archived log files.

Methods

virtual
void
purge(const std::string& path) = 0

Purges archived log files.

The path to the current “hot” log file is given. To find archived log files, look for files with a name consisting of the given path plus any suffix (e.g., .1, .20050929081500, .1.gz). A list of archived files can be obtained by calling the list() method.

void
list(
    const std::string& path,
    std::vector<File>& files
    )

Fills the given vector with a list of archived log files.

The path of the current “hot” log file is given in path.

All files with the same name as the one given in path, plus some suffix (e.g., .1, .20050929081500, .1.gz) are considered archived files.