CaptureMoment 0.1.0
Free and open-source non-destructive photo editor
Loading...
Searching...
No Matches
CaptureMoment::Core::utils Namespace Reference

Concepts

concept  ToStringablePrimitive
 Concept defining types that can be converted to string using std::to_string. This includes integral types (int, long, etc.) and floating-point types (float, double). Note: std::string and bool are handled separately.
 

Functions

template<ToStringablePrimitive T>
std::string toString (T value)
 Converts a primitive value (integral or floating-point) to its string representation.
 
std::string toString (bool value)
 Converts a boolean value to its string representation ("true" or "false").
 
std::string toString (const std::string &value)
 Converts a string value to its string representation (identity operation).
 

Function Documentation

◆ toString() [1/3]

template<ToStringablePrimitive T>
std::string CaptureMoment::Core::utils::toString ( T value)
nodiscard

Converts a primitive value (integral or floating-point) to its string representation.

This function uses std::to_string for numeric types. It is designed for primitive types where std::to_string provides the correct formatting.

Template Parameters
TThe type of the value, constrained by ToStringablePrimitive.
Parameters
valueThe value to convert.
Returns
std::string The string representation of the value.

Definition at line 38 of file to_string_utils.h.

◆ toString() [2/3]

std::string CaptureMoment::Core::utils::toString ( bool value)
inlinenodiscard

Converts a boolean value to its string representation ("true" or "false").

This overload handles the special case of boolean conversion, which differs from the numeric behavior of std::to_string.

Parameters
valueThe boolean value to convert.
Returns
std::string "true" if value is true, "false" otherwise.

Definition at line 51 of file to_string_utils.h.

◆ toString() [3/3]

std::string CaptureMoment::Core::utils::toString ( const std::string & value)
inlinenodiscard

Converts a string value to its string representation (identity operation).

This overload handles the case where the input is already a string, returning a copy of the input string.

Parameters
valueThe string value to convert.
Returns
std::string A copy of the input string.

Definition at line 64 of file to_string_utils.h.

CaptureMoment — footer