rad  2.0.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
rad::Helper Class Reference

#include <helper.hpp>

Public Member Functions

 Helper ()=delete
 
 Helper (const Helper &)=delete
 
Helperoperator= (const Helper &)=delete
 
 Helper ()=delete
 
 Helper (const Helper &)=delete
 
Helperoperator= (const Helper &)=delete
 
 Helper ()=delete
 
 Helper (const Helper &)=delete
 
Helperoperator= (const Helper &)=delete
 

Static Public Member Functions

static std::string GetHostname (const bool with_domain=false)
 
static std::string FindFile (const std::string &filename)
 
static bool FileExists (const std::string &filename)
 
static std::string GetEnvVar (const std::string &key)
 
static std::string CreateIdentity ()
 
static void SplitAddrPort (const std::string addr_port, std::string &addr, int &port)
 
static std::string GetVersion ()
 
static std::string GetHostname (const bool with_domain=false)
 
static std::string FindFile (const std::string &filename)
 
static bool FileExists (const std::string &filename)
 
static std::string GetEnvVar (const std::string &key)
 
static std::string CreateIdentity ()
 
static void SplitAddrPort (const std::string addr_port, std::string &addr, int &port)
 
static std::string GetVersion ()
 
static std::string GetHostname (const bool with_domain=false)
 
static std::string FindFile (const std::string &filename)
 
static bool FileExists (const std::string &filename)
 
static std::string GetEnvVar (const std::string &key)
 
static std::string CreateIdentity ()
 
static void SplitAddrPort (const std::string addr_port, std::string &addr, int &port)
 
static std::string GetVersion ()
 

Static Public Attributes

static constexpr const char * INTROOT = "INTROOT"
 
static constexpr const char * CFGPATH = "CFGPATH"
 

Detailed Description

Class containing static helper methods.

Constructor & Destructor Documentation

rad::Helper::Helper ( )
delete
rad::Helper::Helper ( const Helper )
delete
rad::Helper::Helper ( )
delete
rad::Helper::Helper ( const Helper )
delete
rad::Helper::Helper ( )
delete
rad::Helper::Helper ( const Helper )
delete

Member Function Documentation

std::string rad::Helper::CreateIdentity ( )
static

This function creates Universally Unique Identifier (UUID) using boost/uuid/random_generator library.

Returns
A randomly generated UUID.
static std::string rad::Helper::CreateIdentity ( )
static
static std::string rad::Helper::CreateIdentity ( )
static
static bool rad::Helper::FileExists ( const std::string &  filename)
static
bool rad::Helper::FileExists ( const std::string &  filename)
static

This function checks whether a file exists.

Parameters
[in]filenameName of the file or path to a file.
Returns
true if the file exists, false otherwise.
static bool rad::Helper::FileExists ( const std::string &  filename)
static
static std::string rad::Helper::FindFile ( const std::string &  filename)
static
static std::string rad::Helper::FindFile ( const std::string &  filename)
static
std::string rad::Helper::FindFile ( const std::string &  filename)
static

This function tries to find the location of a file. TODO remove support for INTROOT.

Parameters
[in]filenameName of the file or path to a file to be located.
Returns
The path to a given file or an empty string if the file cannot be located.
static std::string rad::Helper::GetEnvVar ( const std::string &  key)
static
std::string rad::Helper::GetEnvVar ( const std::string &  key)
static

This function checks whether an environment variable exists.

Parameters
[in]keyName of the environment variable.
Returns
The value of the environment variable otherwise an empty string.
static std::string rad::Helper::GetEnvVar ( const std::string &  key)
static
static std::string rad::Helper::GetHostname ( const bool  with_domain = false)
static
static std::string rad::Helper::GetHostname ( const bool  with_domain = false)
static
std::string rad::Helper::GetHostname ( const bool  with_domain = false)
static
Returns
the host name.
static std::string rad::Helper::GetVersion ( )
static
static std::string rad::Helper::GetVersion ( )
static
std::string rad::Helper::GetVersion ( )
static

The version is configured in the project's wscript file and passed to the C++ preprocessor via the -DVERSION macro definition.

Helper& rad::Helper::operator= ( const Helper )
delete
Helper& rad::Helper::operator= ( const Helper )
delete
Helper& rad::Helper::operator= ( const Helper )
delete
static void rad::Helper::SplitAddrPort ( const std::string  addr_port,
std::string &  addr,
int &  port 
)
static
static void rad::Helper::SplitAddrPort ( const std::string  addr_port,
std::string &  addr,
int &  port 
)
static
void rad::Helper::SplitAddrPort ( const std::string  addr_port,
std::string &  addr,
int &  port 
)
static

Split a string composed by an IP address and a port.

Parameters
[in]addr_portIP address and port separated by ':'.
[out]addrIP address.
[out]portPort.

Member Data Documentation

static constexpr const char * rad::Helper::CFGPATH = "CFGPATH"
static
static constexpr const char * rad::Helper::INTROOT = "INTROOT"
static

The documentation for this class was generated from the following files: