AYON Cpp Dev Tools  0.1.0
Loading...
Searching...
No Matches
envVarHelpers.hpp File Reference
#include "../../../../NameSpaceDef/namespaces.hpp"
#include "../../lib/logging/AyonLogger.hpp"
#include <cstdlib>
#include <map>
#include <string>
#include <utility>
#include <vector>
Include dependency graph for envVarHelpers.hpp:

Go to the source code of this file.

Functions

YNPUT_CORE_IOSTD_NAMESPACE_OPEN std::string getEnvKey (const std::string &envKey)
 get the value of an environment key in string format More...
 
std::string cleanEnvKey (std::string &dirtyKey)
 cleans an given environment key from any hidden characters line brakes and similar More...
 
std::vector< std::string > split (const std::string &str, char delimiter)
 splits a given string string via a given delimiter. More...
 
std::vector< std::string > getEnvArray (const std::string &envKey)
 split an env key into an std vector. More...
 
std::map< std::string, std::string > getEnvMap (const std::string &envKey)
 split an environment key into a std::map delimiter = , key value definition = {key}={value} More...
 

Function Documentation

◆ cleanEnvKey()

std::string cleanEnvKey ( std::string &  dirtyKey)

cleans an given environment key from any hidden characters line brakes and similar

Parameters
dirtyKeyinput key
Returns
will return a clean Env Key
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getEnvArray()

std::vector< std::string > getEnvArray ( const std::string &  envKey)

split an env key into an std vector.

array definition. Delimiter ","

Parameters
envKey
Here is the call graph for this function:

◆ getEnvKey()

YNPUT_CORE_IOSTD_NAMESPACE_OPEN std::string getEnvKey ( const std::string &  envKey)

get the value of an environment key in string format

Parameters
envKeythe name of the environment key
Returns
std::string env key value or empty std::string if envKey == nullptr
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getEnvMap()

std::map< std::string, std::string > getEnvMap ( const std::string &  envKey)

split an environment key into a std::map delimiter = , key value definition = {key}={value}

Parameters
envKey
Returns
Here is the call graph for this function:

◆ split()

std::vector< std::string > split ( const std::string &  str,
char  delimiter 
)

splits a given string string via a given delimiter.

useful for splitting Env keys that should be used as a vector or an Map

Parameters
strinput String to be split
delimiterdelimiter used to split the string
Returns
vector of elements resulting from splitting the string by the delimiter. the delimiter will be removed
Here is the call graph for this function:
Here is the caller graph for this function: