Helper class to manage lists of file names.
More...
#include <FileManager.h>
|
static std::string | replacePath (const std::string &imageName, const char *newpath) |
| Convert a pathname into a pathname with the given new path. More...
|
|
Helper class to manage lists of file names.
- Author
- Massimo Balestri
- Date
- 2012
◆ FileManager()
mpeg7cdva::FileManager::FileManager |
( |
const char * |
annotationpathname, |
|
|
int |
level = 0 |
|
) |
| |
Read the list of images from the given annotation file.
- Parameters
-
annotationpathname | the pathname of the annotation text file containing the list of images. |
level | the recursion level (to avoid infinite loops); must be zero when called the first time. |
◆ ~FileManager()
virtual mpeg7cdva::FileManager::~FileManager |
( |
| ) |
|
|
virtual |
◆ countNames()
int mpeg7cdva::FileManager::countNames |
( |
size_t |
i | ) |
const |
Count how many pathnames are contained in the i-th line.
- Parameters
-
i | the index of the image in the annotation file. |
- Returns
- the number of pathnames found.
◆ getDatasetName()
std::string mpeg7cdva::FileManager::getDatasetName |
( |
| ) |
const |
Get the dataset name.
- Returns
- the dataset name
◆ getDatasetPath()
std::string mpeg7cdva::FileManager::getDatasetPath |
( |
| ) |
const |
Get the dataset base directory.
- Returns
- the dataset path
◆ getDatasetPathName()
std::string mpeg7cdva::FileManager::getDatasetPathName |
( |
| ) |
const |
Get the dataset full pathname.
- Returns
- the dataset pathname
◆ getDatasetSize()
size_t mpeg7cdva::FileManager::getDatasetSize |
( |
| ) |
const |
Get the dataset size.
- Returns
- the number of lines read from the filename.
◆ getQueryName()
std::string mpeg7cdva::FileManager::getQueryName |
( |
size_t |
i, |
|
|
bool |
absolutePathname = true |
|
) |
| const |
Get the first image name found at the i-th position in the annotation file.
The image name is provided as an absolute pathname.
- Parameters
-
i | the index of the image in the annotation file. |
absolutePathname | if true, the absolute pathname of the file is returned; otherwise, the relative pathname is returned. |
- Returns
- the relative or absolute pathname of the image.
◆ getReferenceName()
std::string mpeg7cdva::FileManager::getReferenceName |
( |
size_t |
i, |
|
|
bool |
absolutePathname = true |
|
) |
| const |
Get the second image name found at the i-th position in the annotation file.
The image name is provided as an absolute pathname.
- Parameters
-
i | the index of the image in the annotation file. |
absolutePathname | if true, the absolute pathname of the file is returned; otherwise, the relative pathname is returned. |
- Returns
- the relative or absolute pathname of the image.
◆ getWorkspaceDir()
std::string mpeg7cdva::FileManager::getWorkspaceDir |
( |
| ) |
const |
Get the workspace directory.
This is the directory where output files will be stored.
- Returns
- the workspace directory
◆ replaceExt()
std::string mpeg7cdva::FileManager::replaceExt |
( |
const std::string & |
imageName, |
|
|
const char * |
ext |
|
) |
| const |
Convert a pathname into a pathname with the given extension.
- Parameters
-
imageName | the original image/video name; |
ext | new extension; |
- Returns
- the modified pathname.
◆ replacePath()
static std::string mpeg7cdva::FileManager::replacePath |
( |
const std::string & |
imageName, |
|
|
const char * |
newpath |
|
) |
| |
|
static |
Convert a pathname into a pathname with the given new path.
- Parameters
-
imageName | the original image name; |
newpath | the new path; |
- Returns
- the modified pathname.
◆ setWorkspaceDir()
void mpeg7cdva::FileManager::setWorkspaceDir |
( |
const char * |
workdir | ) |
|
Set the workspace directory.
This is the directory where output files will be stored.
- Parameters
-
workdir | the workspace directory |
The documentation for this class was generated from the following file: