Motion Master
Loading...
Searching...
No Matches
od_cache.cc File Reference
#include "od_cache.h"
#include <cctype>
#include <system_error>
#include "util.h"
Include dependency graph for od_cache.cc:

Functions

std::filesystem::path odCacheFilePath (const std::filesystem::path &data_dir, uint32_t vendor_id, uint32_t product_code, uint32_t revision)
 Returns the path of the object dictionary cache file of a device.
OdCacheClearResult clearOdCache (const std::filesystem::path &data_dir)
 Deletes every object dictionary cache file in the data directory.

Function Documentation

◆ clearOdCache()

OdCacheClearResult clearOdCache ( const std::filesystem::path & data_dir)

Deletes every object dictionary cache file in the data directory.

Only files with the layout of odCacheFilePath() are deleted. Other files in the data directory are not touched. A vendor or product folder that is empty afterwards is deleted as well.

Parameters
data_dirThe data directory, see –data-dir. A directory that does not exist holds no cache, and the result is empty.
Returns
The deleted files and the files that could not be deleted.

◆ odCacheFilePath()

std::filesystem::path odCacheFilePath ( const std::filesystem::path & data_dir,
uint32_t vendor_id,
uint32_t product_code,
uint32_t revision )

Returns the path of the object dictionary cache file of a device.

The file is <data-dir>/0x<vendor>/0x<product>/0x<revision>.json, with each number written as 8 lowercase hex digits.

Parameters
data_dirThe data directory, see –data-dir.
vendor_idThe vendor ID from the SII.
product_codeThe product code from the SII.
revisionThe revision number from the SII.
Returns
The path of the cache file. The file need not exist.