Project

General

Profile

SO3Engine
ALStringCleaner Class Reference

#include <ALStringCleaner.h>

Static Public Member Functions

static std::string cleanSpaces (std::string str, bool replace=true, char replaceBy='_')
 Clean a string of spaces, can delete or replace them.
 
static std::string cleanASCII (std::string str, bool replace=true, char replaceBy='_')
 Clean a string of non-ASCII chars, can delete or replace them.
 
static void toLowerCase (std::string str)
 Convert a string to lower case.
 
static std::string getUID ()
 return a unique ID.
 
static std::string curentUID ()
 return the current UID WITHOUT incrementing the UID.
 
static void resetUID ()
 reset the uid to 0.
 
static std::string cleanString (std::string str, bool toLower=true, bool clASCII=true, bool clSpaces=true, bool bUID=true)
 Clean a string.
 

Detailed Description

Definition at line 19 of file ALStringCleaner.h.

Member Function Documentation

◆ cleanASCII()

std::string ALStringCleaner::cleanASCII ( std::string  str,
bool  replace = true,
char  replaceBy = '_' 
)
static

Clean a string of non-ASCII chars, can delete or replace them.

Parameters
str: The string to clean.
replace: True if you want to replace the non-ASCII chars instead of deleting them.
replaceBy: The char who's gonna replace the non-ASCII chars.

Definition at line 38 of file ALStringCleaner.cpp.

◆ cleanSpaces()

std::string ALStringCleaner::cleanSpaces ( std::string  str,
bool  replace = true,
char  replaceBy = '_' 
)
static

Clean a string of spaces, can delete or replace them.

Parameters
str: The string to clean.
replace: True if you want to replace the spaces instead of deleting them.
replaceBy: The char who's gonna replace the spaces.

Definition at line 71 of file ALStringCleaner.cpp.

◆ cleanString()

std::string ALStringCleaner::cleanString ( std::string  str,
bool  toLower = true,
bool  clASCII = true,
bool  clSpaces = true,
bool  bUID = true 
)
static

Clean a string.

Parameters
str: The string to clean.
toLower: If true, will lower case the entire string.
clASCII: If true, will delete non-ASCII chars.
clSpaces: If true, will replace spaces.
bUID: If true, append a unique ID to the string.

Definition at line 130 of file ALStringCleaner.cpp.

◆ curentUID()

std::string ALStringCleaner::curentUID ( )
static

return the current UID WITHOUT incrementing the UID.

Definition at line 116 of file ALStringCleaner.cpp.

◆ getUID()

std::string ALStringCleaner::getUID ( )
static

return a unique ID.

Definition at line 106 of file ALStringCleaner.cpp.

◆ resetUID()

void ALStringCleaner::resetUID ( )
static

reset the uid to 0.

Definition at line 125 of file ALStringCleaner.cpp.

◆ toLowerCase()

void ALStringCleaner::toLowerCase ( std::string  str)
static

Convert a string to lower case.

Parameters
string: String to lower.

Definition at line 96 of file ALStringCleaner.cpp.


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