Format Functions¶
-
group
FormatFunctions This group consists of all the functions used for formatting.
Functions
-
std::string
FormatBase(const std::string &format, std::initializer_list<std::string> args)¶ Outputs a string with all the “{}” replaced with each element in
argsinsideformat.- Return
An
std::stringwith all the “{}” replaced with each element inargsinsideformat.- Parameters
format: Anconst std::string &which needs to be formatted.args: Anstd::initializer_listcontaining format args.
-
std::string
FormatBase(std::string &&format, std::initializer_list<std::string> args)¶ Outputs an
std::stringwith all the “{}” replaced with each element inargsinsideformat.- Return
An
std::stringwith all the “{}” replaced with each element inargsinsideformat.- Parameters
format: Anstd::string &&which needs to be formatted.args: Anstd::initializer_listcontaining format args.
-
template<typename
Type, typename ...IOSFlagTypes>
std::stringToString(const Type &t, IOSFlagTypes... flags)¶ Converts variable of type
Typetostd::stringusingoperator<<.- Return
An
std::stringversion of variable according to theoperator<<.- Template Parameters
Type: Type of variable which will be converted.IOSFlagTypes: A parameter pack of types of functors which will be passed tooperator<<.
- Parameters
t: Variable to convert to string.flags: Flags to pass to stream before variable.
-
template<typename ...
Args>
std::stringFormat(const std::string &format, Args... args)¶ Outputs a string with all the “{}” replaced with positional
argsinsideformat.- Return
- An
std::stringwith all the “{}” replaced withargsinsideformat.- Parameters
format: - Anstd::stringwhich needs to be formatted.args: - Argument pack of variables containing format args.
-
template<typename ...
Args>
std::stringFormat(std::string &&format, Args... args)¶ Outputs a string with all the “{}” replaced with positional
argsinsideformat.- Return
An
std::stringwith all the “{}” replaced withargsinsideformat.- Parameters
format: Anstd::tringwhich needs to be formatted.args: Argument pack of variables containing format args.
-
std::string