HOPS
HOPS class reference
|
Class MHO_DirectoryInterface. More...
#include <MHO_DirectoryInterface.hh>
Public Member Functions | |
MHO_DirectoryInterface () | |
virtual | ~MHO_DirectoryInterface () |
bool | CreateDirectory (const std::string &dirname) const |
Creates a directory with given name and owner permissions. More... | |
void | GetCorelFiles (const std::vector< std::string > &files, std::vector< std::string > &corel_files) const |
extracts legacy mk4 corel files from list of files More... | |
std::string | GetCurrentDirectory () const |
Getter for current directory. More... | |
std::string | GetCurrentParentDirectory () const |
Getter for current parent directory. More... | |
void | GetFileList (std::vector< std::string > &aFileList) const |
Getter for file list. More... | |
void | GetFilesMatchingExtention (std::vector< std::string > &aFileList, const char *anExt) const |
Getter for files matching extention. More... | |
void | GetFilesMatchingExtention (std::vector< std::string > &aFileList, const std::string &anExt) const |
Getter for files matching extention. More... | |
void | GetFilesMatchingPrefix (std::vector< std::string > &aFileList, const char *aPrefix) const |
Getter for files matching prefix. More... | |
void | GetFilesMatchingPrefix (std::vector< std::string > &aFileList, const std::string &aPrefix) const |
Getter for files matching prefix. More... | |
void | GetFringeFiles (const std::vector< std::string > &files, std::vector< std::string > &fringe_files, int &max_sequence_num) const |
extracts legacy mk4 fringe files from list of files More... | |
void | GetRootFile (const std::vector< std::string > &files, std::string &root_file) const |
extracts legacy mk4 root file from list of files More... | |
void | GetStationFiles (const std::vector< std::string > &files, std::vector< std::string > &station_files) const |
extracts legacy mk4 station files from list of files More... | |
void | GetSubDirectoriesMatchingExtention (std::vector< std::string > &aDirList, const char *anExt) const |
void | GetSubDirectoriesMatchingExtention (std::vector< std::string > &aDirList, const std::string &anExt) const |
Getter for sub directories matching extention. More... | |
void | GetSubDirectoryList (std::vector< std::string > &aSubDirList) const |
Getter for sub directory list. More... | |
bool | ReadCurrentDirectory () |
Checks if current directory exists and reads its files and directories. More... | |
void | SetCurrentDirectory (const std::string &dirname) |
Setter for current directory. More... | |
void | SplitCorelFileBasename (const std::string &corel_basename, std::string &st_pair, std::string &root_code) const |
splits out baseline and root code from basename of a legacy mk4 corel file More... | |
void | SplitStationFileBasename (const std::string &station_basename, std::string &st, std::string &root_code) const |
splits out station char and root code from basename of a legacy mk4 station file More... | |
Static Public Member Functions | |
static bool | DoesDirectoryExist (const std::string &dirname) |
Checks if a directory exists by attempting to open it. More... | |
static std::string | GetBasename (const std::string &filename) |
gets the file name from a path to a file More... | |
static std::string | GetDirectoryFullPath (const std::string &dirname) |
Getter for directory full path. More... | |
static std::string | GetDirectoryFullPathPreserveSymlinks (const std::string &dirname) |
Getter for directory full path preserve symlinks. More... | |
static std::string | GetFileModifcationTime (const std::string &name) |
Getter for file modifcation time. More... | |
static std::string | GetPrefix (const std::string &filename) |
gets the directory prefix from a full path to a file More... | |
static bool | IsDirectory (const std::string &name) |
Checks if a given path is a directory. More... | |
static bool | IsFile (const std::string &name) |
Checks if a given path is a regular file. More... | |
static std::string | StripExtensionFromBasename (const std::string &file_basename) |
removes the extention (anything after last '.') from a file (base) name More... | |
Class MHO_DirectoryInterface.
implements utility functions to access a directory and locate files
hops::MHO_DirectoryInterface::MHO_DirectoryInterface | ( | ) |
|
virtual |
bool hops::MHO_DirectoryInterface::CreateDirectory | ( | const std::string & | dirname | ) | const |
Creates a directory with given name and owner permissions.
dirname | The name of the directory to create. |
|
static |
Checks if a directory exists by attempting to open it.
dirname | The name of the directory to check. |
|
static |
gets the file name from a path to a file
void hops::MHO_DirectoryInterface::GetCorelFiles | ( | const std::vector< std::string > & | files, |
std::vector< std::string > & | corel_files | ||
) | const |
extracts legacy mk4 corel files from list of files
std::string hops::MHO_DirectoryInterface::GetCurrentDirectory | ( | ) | const |
Getter for current directory.
std::string hops::MHO_DirectoryInterface::GetCurrentParentDirectory | ( | ) | const |
Getter for current parent directory.
|
static |
Getter for directory full path.
dirname | The directory name to resolve. |
|
static |
Getter for directory full path preserve symlinks.
dirname | Input directory name |
void hops::MHO_DirectoryInterface::GetFileList | ( | std::vector< std::string > & | aFileList | ) | const |
Getter for file list.
aFileList | Output parameter: vector of strings to store file list |
|
static |
Getter for file modifcation time.
name | The name of the file to retrieve modification time for. |
void hops::MHO_DirectoryInterface::GetFilesMatchingExtention | ( | std::vector< std::string > & | aFileList, |
const char * | anExt | ||
) | const |
Getter for files matching extention.
aFileList | Output vector to store matching file names |
anExt | Extension to match against |
void hops::MHO_DirectoryInterface::GetFilesMatchingExtention | ( | std::vector< std::string > & | aFileList, |
const std::string & | anExt | ||
) | const |
Getter for files matching extention.
aFileList | Output vector to store matching file names. |
anExt | Extension pattern to match. |
void hops::MHO_DirectoryInterface::GetFilesMatchingPrefix | ( | std::vector< std::string > & | aFileList, |
const char * | aPrefix | ||
) | const |
Getter for files matching prefix.
aFileList | Output vector of matching file names |
aPrefix | Input string prefix to match against file names |
void hops::MHO_DirectoryInterface::GetFilesMatchingPrefix | ( | std::vector< std::string > & | aFileList, |
const std::string & | aPrefix | ||
) | const |
Getter for files matching prefix.
aFileList | Output vector of matching file names |
aPrefix | Input string prefix to match against file names |
void hops::MHO_DirectoryInterface::GetFringeFiles | ( | const std::vector< std::string > & | files, |
std::vector< std::string > & | fringe_files, | ||
int & | max_sequence_num | ||
) | const |
extracts legacy mk4 fringe files from list of files
|
static |
gets the directory prefix from a full path to a file
void hops::MHO_DirectoryInterface::GetRootFile | ( | const std::vector< std::string > & | files, |
std::string & | root_file | ||
) | const |
extracts legacy mk4 root file from list of files
void hops::MHO_DirectoryInterface::GetStationFiles | ( | const std::vector< std::string > & | files, |
std::vector< std::string > & | station_files | ||
) | const |
extracts legacy mk4 station files from list of files
void hops::MHO_DirectoryInterface::GetSubDirectoriesMatchingExtention | ( | std::vector< std::string > & | aDirList, |
const char * | anExt | ||
) | const |
void hops::MHO_DirectoryInterface::GetSubDirectoriesMatchingExtention | ( | std::vector< std::string > & | aDirList, |
const std::string & | anExt | ||
) | const |
Getter for sub directories matching extention.
aDirList | Output vector to store matching directories |
anExt | Extension to match for filtering directories |
void hops::MHO_DirectoryInterface::GetSubDirectoryList | ( | std::vector< std::string > & | aSubDirList | ) | const |
Getter for sub directory list.
aSubDirList | Output parameter: vector to store subdirectory list |
|
static |
Checks if a given path is a directory.
name | Path to check. |
|
static |
Checks if a given path is a regular file.
name | Path to check as std::string&. |
bool hops::MHO_DirectoryInterface::ReadCurrentDirectory | ( | ) |
Checks if current directory exists and reads its files and directories.
void hops::MHO_DirectoryInterface::SetCurrentDirectory | ( | const std::string & | dirname | ) |
Setter for current directory.
dirname | The new directory path to set. |
void hops::MHO_DirectoryInterface::SplitCorelFileBasename | ( | const std::string & | corel_basename, |
std::string & | st_pair, | ||
std::string & | root_code | ||
) | const |
splits out baseline and root code from basename of a legacy mk4 corel file
void hops::MHO_DirectoryInterface::SplitStationFileBasename | ( | const std::string & | station_basename, |
std::string & | st, | ||
std::string & | root_code | ||
) | const |
splits out station char and root code from basename of a legacy mk4 station file
|
static |
removes the extention (anything after last '.') from a file (base) name