Pioneer
Loading...
Searching...
No Matches
Macros | Functions
StringUtils.cpp File Reference
#include "StringUtils.h"
#include "Lang.h"
#include "DateTime.h"
#include "fmt/core.h"
#include "gameconsts.h"
#include <cinttypes>
#include <sstream>
#include <cassert>
Include dependency graph for StringUtils.cpp:

Macros

#define TOLOWER(c)   (isupper(static_cast<unsigned char>(c)) ? tolower(static_cast<unsigned char>(c)) : (static_cast<unsigned char>(c)))
 

Functions

std::string format_money (double cents, bool showCents)
 
std::string format_date (double t)
 
std::string format_date_only (double t)
 
std::string string_join (std::vector< std::string > &v, std::string sep)
 
std::string format_duration (double seconds)
 
std::string format_distance (double dist, int precision)
 
const char * pi_strcasestr (const char *haystack, const char *needle)
 
std::string FloatToStr (float val)
 
std::string DoubleToStr (double val)
 
std::string AutoToStr (Sint32 val)
 
std::string AutoToStr (Sint64 val)
 
std::string AutoToStr (float val)
 
std::string AutoToStr (double val)
 
Sint64 StrToSInt64 (const std::string &str)
 
Uint64 StrToUInt64 (const std::string &str)
 
float StrToFloat (const std::string &str)
 
double StrToDouble (const std::string &str)
 
void StrToAuto (Sint32 *pVal, const std::string &str)
 
void StrToAuto (Sint64 *pVal, const std::string &str)
 
void StrToAuto (float *pVal, const std::string &str)
 
void StrToAuto (double *pVal, const std::string &str)
 
std::string DecimalToDegMinSec (float dec)
 

Macro Definition Documentation

◆ TOLOWER

#define TOLOWER (   c)    (isupper(static_cast<unsigned char>(c)) ? tolower(static_cast<unsigned char>(c)) : (static_cast<unsigned char>(c)))

Function Documentation

◆ AutoToStr() [1/4]

std::string AutoToStr ( double  val)
Here is the call graph for this function:

◆ AutoToStr() [2/4]

std::string AutoToStr ( float  val)
Here is the call graph for this function:

◆ AutoToStr() [3/4]

std::string AutoToStr ( Sint32  val)

◆ AutoToStr() [4/4]

std::string AutoToStr ( Sint64  val)

◆ DecimalToDegMinSec()

std::string DecimalToDegMinSec ( float  dec)

Converts geographic coordinates from decimal to degree/minutes/seconds format and returns a string.

◆ DoubleToStr()

std::string DoubleToStr ( double  val)

◆ FloatToStr()

std::string FloatToStr ( float  val)

◆ format_date()

std::string format_date ( double  t)
Here is the call graph for this function:

◆ format_date_only()

std::string format_date_only ( double  t)
Here is the call graph for this function:

◆ format_distance()

std::string format_distance ( double  dist,
int  precision 
)

◆ format_duration()

std::string format_duration ( double  seconds)

◆ format_money()

std::string format_money ( double  cents,
bool  showCents 
)

◆ pi_strcasestr()

const char * pi_strcasestr ( const char *  haystack,
const char *  needle 
)

◆ string_join()

std::string string_join ( std::vector< std::string > &  v,
std::string  sep 
)

◆ StrToAuto() [1/4]

void StrToAuto ( double *  pVal,
const std::string &  str 
)
Here is the call graph for this function:

◆ StrToAuto() [2/4]

void StrToAuto ( float *  pVal,
const std::string &  str 
)
Here is the call graph for this function:

◆ StrToAuto() [3/4]

void StrToAuto ( Sint32 *  pVal,
const std::string &  str 
)

◆ StrToAuto() [4/4]

void StrToAuto ( Sint64 *  pVal,
const std::string &  str 
)

◆ StrToDouble()

double StrToDouble ( const std::string &  str)

◆ StrToFloat()

float StrToFloat ( const std::string &  str)

◆ StrToSInt64()

Sint64 StrToSInt64 ( const std::string &  str)

◆ StrToUInt64()

Uint64 StrToUInt64 ( const std::string &  str)