Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members

RageUtil.cpp File Reference

#include "global.h"
#include "RageMath.h"
#include "RageUtil.h"
#include "RageLog.h"
#include "RageFile.h"
#include "arch/arch.h"
#include <numeric>
#include <ctime>
#include <map>
#include <sys/types.h>
#include <sys/stat.h>
#include "pcre/pcre.h"

Functions

float RandomFloat (int &seed)
void fapproach (float &val, float other_val, float to_move)
float fmodfp (float x, float y)
int power_of_two (int input)
bool IsAnInt (const CString &s)
bool IsHexVal (const CString &s)
float HHMMSSToSeconds (const CString &sHHMMSS)
CString SecondsToHHMMSS (float fSecs)
CString SecondsToMMSSMsMs (float fSecs)
CString SecondsToMMSSMsMsMs (float fSecs)
CString PrettyPercent (float fNumerator, float fDenominator)
CString Commify (int iNum)
tm GetLocalTime ()
CString ssprintf (const char *fmt,...)
CString vssprintf (const char *fmt, va_list argList)
CString join (const CString &Deliminator, const CStringArray &Source)
CString join (const CString &Delimitor, CStringArray::const_iterator begin, CStringArray::const_iterator end)
template<class S> int DelimitorLength (const S &Delimitor)
int DelimitorLength (char Delimitor)
int DelimitorLength (wchar_t Delimitor)
template<class S, class C> void do_split (const S &Source, const C Delimitor, vector< S > &AddIt, const bool bIgnoreEmpty)
void split (const CString &Source, const CString &Delimitor, CStringArray &AddIt, const bool bIgnoreEmpty)
void split (const wstring &Source, const wstring &Delimitor, vector< wstring > &AddIt, const bool bIgnoreEmpty)
template<class S> void do_split (const S &Source, const S &Delimitor, int &begin, int &size, int len, const bool bIgnoreEmpty)
void split (const CString &Source, const CString &Delimitor, int &begin, int &size, int len, const bool bIgnoreEmpty)
void split (const wstring &Source, const wstring &Delimitor, int &begin, int &size, int len, const bool bIgnoreEmpty)
void split (const CString &Source, const CString &Delimitor, int &begin, int &size, const bool bIgnoreEmpty)
void split (const wstring &Source, const wstring &Delimitor, int &begin, int &size, const bool bIgnoreEmpty)
void splitpath (const CString &Path, CString &Dir, CString &Filename, CString &Ext)
CString SetExtension (const CString &path, const CString &ext)
CString GetExtension (const CString &sPath)
CString GetCwd ()
void CRC32 (unsigned int &iCRC, const void *pVoidBuffer, size_t iSize)
unsigned int GetHashForString (const CString &s)
bool DirectoryIsEmpty (const CString &dir)
bool CompareCStringsAsc (const CString &str1, const CString &str2)
bool CompareCStringsDesc (const CString &str1, const CString &str2)
void SortCStringArray (CStringArray &arrayCStrings, const bool bSortAscending)
float calc_mean (const float *start, const float *end)
float calc_stddev (const float *start, const float *end)
void TrimLeft (CString &str, const char *s)
void TrimRight (CString &str, const char *s)
void StripCrnl (CString &s)
CString DerefRedir (const CString &path)
CString GetRedirContents (const CString &path)
int utf8_get_char_len (char p)
bool is_utf8_continuation_byte (char c)
bool utf8_to_wchar_ec (const CString &s, unsigned &start, wchar_t &ch)
bool utf8_to_wchar (const CString &s, unsigned &start, wchar_t &ch)
void wchar_to_utf8 (wchar_t ch, CString &out)
wchar_t utf8_get_char (const CString &s)
void utf8_sanitize (CString &s)
bool utf8_is_valid (const CString &s)
void utf8_remove_bom (CString &sLine)
wstring CStringToWstring (const CString &s)
CString WStringToCString (const wstring &str)
CString WcharToUTF8 (wchar_t c)
void Replace_Unicode_Markers (CString &Text)
CString WcharDisplayText (wchar_t c)
CString Basename (const CString &dir)
CString Dirname (const CString &dir)
CString Capitalize (const CString &s)
void FixSlashesInPlace (CString &sPath)
CString FixSlashes (CString sPath)
void CollapsePath (CString &sPath, bool bRemoveLeadingDot)
bool FromString (const CString &sValue, int &out)
bool FromString (const CString &sValue, unsigned &out)
bool FromString (const CString &sValue, float &out)
bool FromString (const CString &sValue, bool &out)
CString ToString (int value)
CString ToString (unsigned value)
CString ToString (float value)
CString ToString (bool value)
bool FileRead (RageFile &f, CString &sOut)
bool FileRead (RageFile &f, int &iOut)
bool FileRead (RageFile &f, unsigned &uOut)
bool FileRead (RageFile &f, float &fOut)
void FileWrite (RageFile &f, const CString &sWrite)
void FileWrite (RageFile &f, int iWrite)
void FileWrite (RageFile &f, size_t uWrite)
void FileWrite (RageFile &f, float fWrite)
bool FileCopy (CString sSrcFile, CString sDstFile)

Variables

int randseed = time(NULL)
const wchar_t INVALID_CHAR = 0xFFFD

Function Documentation

CString Basename const CString &  dir  ) 
 

float calc_mean const float *  start,
const float *  end
 

float calc_stddev const float *  start,
const float *  end
 

CString Capitalize const CString &  s  ) 
 

void CollapsePath CString &  sPath,
bool  bRemoveLeadingDot
 

CString Commify int  iNum  ) 
 

bool CompareCStringsAsc const CString &  str1,
const CString &  str2
 

bool CompareCStringsDesc const CString &  str1,
const CString &  str2
 

void CRC32 unsigned int iCRC,
const void *  pVoidBuffer,
size_t  iSize
 

wstring CStringToWstring const CString &  s  ) 
 

int DelimitorLength wchar_t  Delimitor  )  [static]
 

int DelimitorLength char  Delimitor  )  [static]
 

template<class S>
int DelimitorLength const S &  Delimitor  )  [static]
 

CString DerefRedir const CString &  path  ) 
 

bool DirectoryIsEmpty const CString &  dir  ) 
 

CString Dirname const CString &  dir  ) 
 

template<class S>
void do_split const S &  Source,
const S &  Delimitor,
int begin,
int size,
int  len,
const bool  bIgnoreEmpty
 

template<class S, class C>
void do_split const S &  Source,
const C  Delimitor,
vector< S > &  AddIt,
const bool  bIgnoreEmpty
 

void fapproach float &  val,
float  other_val,
float  to_move
 

bool FileCopy CString  sSrcFile,
CString  sDstFile
 

bool FileRead RageFile f,
float &  fOut
 

bool FileRead RageFile f,
unsigned &  uOut
 

bool FileRead RageFile f,
int iOut
 

bool FileRead RageFile f,
CString &  sOut
 

void FileWrite RageFile f,
float  fWrite
 

void FileWrite RageFile f,
size_t  uWrite
 

void FileWrite RageFile f,
int  iWrite
 

void FileWrite RageFile f,
const CString &  sWrite
 

CString FixSlashes CString  sPath  ) 
 

void FixSlashesInPlace CString &  sPath  ) 
 

float fmodfp float  x,
float  y
 

bool FromString const CString &  sValue,
bool &  out
 

bool FromString const CString &  sValue,
float &  out
 

bool FromString const CString &  sValue,
unsigned &  out
 

bool FromString const CString &  sValue,
int out
 

CString GetCwd  ) 
 

CString GetExtension const CString &  sPath  ) 
 

unsigned int GetHashForString const CString &  s  ) 
 

struct tm GetLocalTime  ) 
 

CString GetRedirContents const CString &  path  ) 
 

float HHMMSSToSeconds const CString &  sHHMMSS  ) 
 

bool is_utf8_continuation_byte char  c  )  [inline, static]
 

bool IsAnInt const CString &  s  ) 
 

bool IsHexVal const CString &  s  ) 
 

CString join const CString &  Delimitor,
CStringArray::const_iterator  begin,
CStringArray::const_iterator  end
 

CString join const CString &  Deliminator,
const CStringArray &  Source
 

int power_of_two int  input  ) 
 

CString PrettyPercent float  fNumerator,
float  fDenominator
 

float RandomFloat int seed  ) 
 

void Replace_Unicode_Markers CString &  Text  ) 
 

CString SecondsToHHMMSS float  fSecs  ) 
 

CString SecondsToMMSSMsMs float  fSecs  ) 
 

CString SecondsToMMSSMsMsMs float  fSecs  ) 
 

CString SetExtension const CString &  path,
const CString &  ext
 

void SortCStringArray CStringArray &  arrayCStrings,
const bool  bSortAscending
 

void split const wstring &  Source,
const wstring &  Delimitor,
int begin,
int size,
const bool  bIgnoreEmpty
 

void split const CString &  Source,
const CString &  Delimitor,
int begin,
int size,
const bool  bIgnoreEmpty
 

void split const wstring &  Source,
const wstring &  Delimitor,
int begin,
int size,
int  len,
const bool  bIgnoreEmpty
 

void split const CString &  Source,
const CString &  Delimitor,
int begin,
int size,
int  len,
const bool  bIgnoreEmpty
 

void split const wstring &  Source,
const wstring &  Delimitor,
vector< wstring > &  AddIt,
const bool  bIgnoreEmpty
 

void split const CString &  Source,
const CString &  Delimitor,
CStringArray &  AddIt,
const bool  bIgnoreEmpty
 

void splitpath const CString &  Path,
CString &  Dir,
CString &  Filename,
CString &  Ext
 

CString ssprintf const char *  fmt,
  ...
 

void StripCrnl CString &  s  ) 
 

CString ToString bool  value  ) 
 

CString ToString float  value  ) 
 

CString ToString unsigned  value  ) 
 

CString ToString int  value  ) 
 

void TrimLeft CString &  str,
const char *  s
 

void TrimRight CString &  str,
const char *  s
 

wchar_t utf8_get_char const CString &  s  ) 
 

int utf8_get_char_len char  p  ) 
 

bool utf8_is_valid const CString &  s  ) 
 

void utf8_remove_bom CString &  sLine  ) 
 

void utf8_sanitize CString &  s  ) 
 

bool utf8_to_wchar const CString &  s,
unsigned &  start,
wchar_t &  ch
 

bool utf8_to_wchar_ec const CString &  s,
unsigned &  start,
wchar_t &  ch
 

CString vssprintf const char *  fmt,
va_list  argList
 

void wchar_to_utf8 wchar_t  ch,
CString &  out
 

CString WcharDisplayText wchar_t  c  ) 
 

CString WcharToUTF8 wchar_t  c  ) 
 

CString WStringToCString const wstring &  str  ) 
 


Variable Documentation

const wchar_t INVALID_CHAR = 0xFFFD
 

int randseed = time(NULL)
 


Generated on Thu Jan 27 20:57:59 2005 for StepMania by doxygen 1.3.7