DDS  ver. 3.5.3.8.g5fe284b
Typedefs | Functions
MiscCommon::BOOSTHelper Namespace Reference

a BOOST helpers namespace More...

Typedefs

typedef boost::shared_ptr< boost::thread > Thread_PTR_t
 A smart pointer wrapper for boost::thread pointers. More...
 

Functions

std::string get_temp_dir (const std::string &_prefix)
 
void get_files_by_extension (const fs::path &_root, const std::string &_ext, std::vector< fs::path > &_ret)
 The function return a list of files in the deirectory with specified extension. More...
 
std::string normalize_path (const std::string &_path)
 The normalize_path() function removes '/' characters at the end of the of the input pathname. More...
 
bool is_file (const std::string &_pathname)
 The is_file() function checks whether the pathname represents a file or not. More...
 
bool is_directory (const std::string &_pathname)
 the is_directory() function checks whether the pathname represents a directory or not More...
 
void conflicting_options (const boost::program_options::variables_map &_vm, const char *_opt1, const char *_opt2)
 The conflicting_options function used to check that 'opt1' and 'opt2' are not specified at the same time. More...
 
void option_dependency (const boost::program_options::variables_map &_vm, const char *_for_what, const char *_required_option)
 The option_dependency function used to check that if 'for_what' is specified, then 'required_option' is specified too. More...
 

Detailed Description

a BOOST helpers namespace

Typedef Documentation

◆ Thread_PTR_t

typedef boost::shared_ptr<boost::thread> MiscCommon::BOOSTHelper::Thread_PTR_t

A smart pointer wrapper for boost::thread pointers.

Function Documentation

◆ conflicting_options()

void MiscCommon::BOOSTHelper::conflicting_options ( const boost::program_options::variables_map &  _vm,
const char *  _opt1,
const char *  _opt2 
)
inline

The conflicting_options function used to check that 'opt1' and 'opt2' are not specified at the same time.

Parameters
[in]_vm- a BOOST program options variable map.
[in]_opt1- the first option to check.
[in]_opt2- the second option to check.
Exceptions
std::runtime_error- thrown if the 'opt1' and 'opt2' are specified at the same time.
Returns
no return value.

◆ get_files_by_extension()

void MiscCommon::BOOSTHelper::get_files_by_extension ( const fs::path &  _root,
const std::string &  _ext,
std::vector< fs::path > &  _ret 
)
inline

The function return a list of files in the deirectory with specified extension.

Parameters
[in]_root- root of the directory to process.
[in]_ext- extension, for example ".log".
[out]_ret- vector of pathes to files.

◆ get_temp_dir()

std::string MiscCommon::BOOSTHelper::get_temp_dir ( const std::string &  _prefix)
inline

◆ is_directory()

bool MiscCommon::BOOSTHelper::is_directory ( const std::string &  _pathname)
inline

the is_directory() function checks whether the pathname represents a directory or not

Parameters
[in]_pathname- a path name.
Returns
true if the given path represents a directory and false otherwise.

◆ is_file()

bool MiscCommon::BOOSTHelper::is_file ( const std::string &  _pathname)
inline

The is_file() function checks whether the pathname represents a file or not.

Parameters
[in]_pathname- a full path to check.
Returns
true if the given path represents a file and false otherwise.

◆ normalize_path()

std::string MiscCommon::BOOSTHelper::normalize_path ( const std::string &  _path)
inline

The normalize_path() function removes '/' characters at the end of the of the input pathname.

Parameters
[in]_path- path to process.
Returns
a string, which holds the normalized path.

◆ option_dependency()

void MiscCommon::BOOSTHelper::option_dependency ( const boost::program_options::variables_map &  _vm,
const char *  _for_what,
const char *  _required_option 
)
inline

The option_dependency function used to check that if 'for_what' is specified, then 'required_option' is specified too.

Parameters
[in]_vm- a BOOST program options variable map.
[in]_for_what- option to check.
[in]_required_option- required option.
Exceptions
std::runtime_error- thrown if 'for_what' is specified but there is no 'required_option' found.
Returns
no return value.