rad  3.0.0
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

◆ Helper() [1/6]

rad::Helper::Helper ( )
delete

◆ Helper() [2/6]

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

◆ Helper() [3/6]

rad::Helper::Helper ( )
delete

◆ Helper() [4/6]

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

◆ Helper() [5/6]

rad::Helper::Helper ( )
delete

◆ Helper() [6/6]

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

Member Function Documentation

◆ CreateIdentity() [1/3]

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

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

Returns
A randomly generated UUID.

◆ CreateIdentity() [2/3]

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

◆ CreateIdentity() [3/3]

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

◆ FileExists() [1/3]

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.

◆ FileExists() [2/3]

static bool rad::Helper::FileExists ( const std::string &  filename)
static

◆ FileExists() [3/3]

static bool rad::Helper::FileExists ( const std::string &  filename)
static

◆ FindFile() [1/3]

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.

◆ FindFile() [2/3]

static std::string rad::Helper::FindFile ( const std::string &  filename)
static

◆ FindFile() [3/3]

static std::string rad::Helper::FindFile ( const std::string &  filename)
static

◆ GetEnvVar() [1/3]

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.

◆ GetEnvVar() [2/3]

static std::string rad::Helper::GetEnvVar ( const std::string &  key)
static

◆ GetEnvVar() [3/3]

static std::string rad::Helper::GetEnvVar ( const std::string &  key)
static

◆ GetHostname() [1/3]

std::string rad::Helper::GetHostname ( const bool  with_domain = false)
static
Returns
the host name.

◆ GetHostname() [2/3]

static std::string rad::Helper::GetHostname ( const bool  with_domain = false)
static

◆ GetHostname() [3/3]

static std::string rad::Helper::GetHostname ( const bool  with_domain = false)
static

◆ GetVersion() [1/3]

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.

◆ GetVersion() [2/3]

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

◆ GetVersion() [3/3]

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

◆ operator=() [1/3]

Helper& rad::Helper::operator= ( const Helper )
delete

◆ operator=() [2/3]

Helper& rad::Helper::operator= ( const Helper )
delete

◆ operator=() [3/3]

Helper& rad::Helper::operator= ( const Helper )
delete

◆ SplitAddrPort() [1/3]

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.

◆ SplitAddrPort() [2/3]

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

◆ SplitAddrPort() [3/3]

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

Member Data Documentation

◆ CFGPATH

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

◆ INTROOT

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

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