winss
Static Public Member Functions | List of all members
winss::Utils Class Reference

Utility functions. More...

#include <utils.hpp>

Static Public Member Functions

static std::string ExpandEnvironmentVariables (const std::string &value)
 Expand the given string with environment variables. More...
 
static winss::env_t GetEnvironmentVariables ()
 Gets a mapping of the current environment variables. More...
 
static std::vector< char > GetEnvironmentString (const winss::env_t &env)
 Gets a string for the given environment variables. More...
 
static std::vector< std::string > SplitString (const std::string &input)
 Splits the string based on a new line. More...
 
static std::string ConvertToISOString (const std::chrono::system_clock::time_point &time_point)
 Convert the time to a ISO string. More...
 
static std::chrono::system_clock::time_point ConvertFromISOString (const std::string &iso_string)
 Convert an ISO string to a time point. More...
 

Detailed Description

Utility functions.

Member Function Documentation

std::chrono::system_clock::time_point winss::Utils::ConvertFromISOString ( const std::string &  iso_string)
static

Convert an ISO string to a time point.

Parameters
iso_stringThe ISO string to convert.
Returns
The time point.

Referenced by winss::SuperviseStateFile::Read().

std::string winss::Utils::ConvertToISOString ( const std::chrono::system_clock::time_point &  time_point)
static

Convert the time to a ISO string.

Parameters
time_pointThe time point to convert.
Returns
The ISO string.

Referenced by winss::SuperviseStateFile::Notify(), and winss::LogTmpl< TMutex >::Start().

std::string winss::Utils::ExpandEnvironmentVariables ( const std::string &  value)
static

Expand the given string with environment variables.

Strings like ENV_KEY% will be replaces with the environment variable value.

Parameters
valueThe string to replace environment variables.
Returns
A new string with the replacements filled in.

References WINDOWS.

Referenced by winss::Environment::ReadEnv(), winss::SuperviseTmpl< TMutex, TProcess >::Start(), winss::SvScanTmpl< TService, TMutex, TProcess >::Stop(), and winss::SvScanTmpl< TService, TMutex, TProcess >::Terminate().

std::vector< char > winss::Utils::GetEnvironmentString ( const winss::env_t env)
static

Gets a string for the given environment variables.

Parameters
envThe environment key values.
Returns
An environment string.

Referenced by winss::Environment::ReadEnv().

winss::env_t winss::Utils::GetEnvironmentVariables ( )
static

Gets a mapping of the current environment variables.

Returns
The environment as a mapping of keys to values.

References WINDOWS.

Referenced by winss::Environment::ReadEnv().

std::vector< std::string > winss::Utils::SplitString ( const std::string &  input)
static

Splits the string based on a new line.

Parameters
inputThe string to split.
Returns
A vector or strings from the input that no longer have new lines in them.

Referenced by winss::EnvironmentDir::ReadEnvSource().


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