Poco::OSP

class CodeCache

Library: OSP
Package: Util
Header: Poco/OSP/CodeCache.h

Description

CodeCache is a utility class that manages the code cache directory where the shared libraries of resolved bundles are kept.

Member Summary

Member Functions: clear, hasLibrary, installLibrary, pathFor, uninstallLibrary

Constructors

CodeCache

CodeCache(
    const std::string & path
);

Creates the CodeCache, using the given path.

If the cache directory does not exist, it is created.

Destructor

~CodeCache

~CodeCache();

Destroys the CodeCache.

Member Functions

clear

void clear();

Clears the cache by removing the entire cache directory.

hasLibrary

bool hasLibrary(
    const std::string & name
);

Returns true if a library with the given name is stored in the code cache.

The name must not contain an filename extension.

installLibrary

void installLibrary(
    const std::string & name,
    std::istream & istr
);

Installs the library with the given name, which must not contain an extension, into the code cache.

pathFor

std::string pathFor(
    const std::string & name
);

Returns the full path for the library with the given name.

uninstallLibrary

void uninstallLibrary(
    const std::string & name
);

Removes the library with the given name from the cache directory.