Simple-Log  alpha-v0.7
sl::log::StringPattern Class Reference

Helper class for generating patterned strings. More...

#include <StringPattern.hpp>

Public Member Functions

 StringPattern () noexcept=default
 Default Constructor. More...
 
 StringPattern (std::string patternString)
 Constructor. More...
 
std::string next ()
 Creates a new string. More...
 
std::string_view patternString () const noexcept
 Getter of the used pattern string. More...
 
void setPatternString (std::string patternString)
 Sets the pattern string. More...
 

Detailed Description

Helper class for generating patterned strings.

Tokenize the pattern string and creates generators, which will then create the actual substrings on demand.

Constructor & Destructor Documentation

◆ StringPattern() [1/2]

sl::log::StringPattern::StringPattern ( )
defaultnoexcept

Default Constructor.

◆ StringPattern() [2/2]

sl::log::StringPattern::StringPattern ( std::string  patternString)
inlineexplicit

Constructor.

Parameters
patternStringPattern

Member Function Documentation

◆ next()

std::string sl::log::StringPattern::next ( )
inline

Creates a new string.

The returned string will be created on demand and follows the pattern string rules.

Returns
Generated string.

◆ patternString()

std::string_view sl::log::StringPattern::patternString ( ) const
inlinenoexcept

Getter of the used pattern string.

Returns
A std::string_view on the pattern string

◆ setPatternString()

void sl::log::StringPattern::setPatternString ( std::string  patternString)
inline

Sets the pattern string.

Parameters
patternStringThe given pattern string

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