JBWOPR
Loading...
Searching...
No Matches
JBStringHelper Class Reference

This class contains helper functions for string related tasks. More...

#include <jbwoprhelpers.h>

Static Public Member Functions

static std::string getCenteredString (const std::string str, const uint32_t length, char padChar=' ')
 Get centered string.
 
static std::string getRightAlignedString (std::string str, uint32_t length, char padChar=' ')
 Get right aligned string.
 
static std::string rgbToString (uint32_t rgbValue)
 Get hex coded color string.
 
static uint32_t stringToRgb (std::string rgbString)
 Get RGB value from hex coded color string.
 

Detailed Description

This class contains helper functions for string related tasks.

Member Function Documentation

◆ getCenteredString()

std::string JBStringHelper::getCenteredString ( const std::string  str,
const uint32_t  length,
char  padChar = ' ' 
)
static

Get centered string.

Parameters
strString to center
lengthLength of centered string
padCharCharacter to pad with, default is space

◆ getRightAlignedString()

std::string JBStringHelper::getRightAlignedString ( std::string  str,
uint32_t  length,
char  padChar = ' ' 
)
static

Get right aligned string.

Parameters
strString to right align
lengthLength of right aligned string
padCharCharacter to pad with, default is space

◆ rgbToString()

std::string JBStringHelper::rgbToString ( uint32_t  rgbValue)
static

Get hex coded color string.

Parameters
rgbValueRGB value
Returns
Hex coded color string

◆ stringToRgb()

uint32_t JBStringHelper::stringToRgb ( std::string  rgbString)
static

Get RGB value from hex coded color string.

Parameters
rgbStringHex coded color string
Returns
RGB value

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