OpenBarnyard
 
Loading...
Searching...
No Matches
TStringManager.h
Go to the documentation of this file.
1#pragma once
2#include "T2String8.h"
3#include "T2String16.h"
4
5#include <cstdarg>
6
8
10{
11public:
13 static TINT String8Compare( const TCHAR* str1, const TCHAR* str2, TSIZE size = -1 ) { return T2String8::Compare( str1, str2, size ); }
14 static TINT String8CompareNoCase( const TCHAR* str1, const TCHAR* str2, TSIZE size = -1 ) { return T2String8::CompareNoCase( str1, str2, size ); }
15 static TCHAR* String8Copy( TCHAR* dst, const TCHAR* src, TSIZE size = -1 ) { return T2String8::Copy( dst, src, size ); }
16 static TCHAR* String8CopySafe( TCHAR* dst, const TCHAR* src, TSIZE size = -1 ) { return T2String8::CopySafe( dst, src, size ); }
17 static const TCHAR* String8FindChar( const TCHAR* str, TCHAR character ) { return T2String8::FindChar( str, character ); }
18 static const TCHAR* String8FindString( const TCHAR* str, const TCHAR* substr ) { return T2String8::FindString( str, substr ); }
19 static TSIZE String8Length( const TCHAR* str ) { return T2String8::Length( str ); }
20 static void String8ToLowerCase( TCHAR* str ) { T2String8::ToLowerCase( str ); }
21 static TFLOAT String8ToFloat( const TCHAR* str ) { return T2String8::StringToFloat( str ); }
22
23 static void String8Format( TCHAR* str, TINT size, const TCHAR* format, ... )
24 {
25 va_list args;
26
27 va_start( args, format );
28
29 T2String8::FormatV( str, size, format, args );
30
31 va_end( args );
32 }
33
35 static TINT String16Compare( const TWCHAR* str1, const TWCHAR* str2, TSIZE size = -1 ) { return T2String16::Compare( str1, str2, size ); }
36 static TINT String16CompareNoCase( const TWCHAR* str1, const TWCHAR* str2, TSIZE size = -1 ) { return T2String16::CompareNoCase( str1, str2, size ); }
37 static TWCHAR* String16Copy( TWCHAR* dst, const TWCHAR* src, TSIZE size = -1 ) { return T2String16::Copy( dst, src, size ); }
38 static TWCHAR* String16CopySafe( TWCHAR* dst, const TWCHAR* src, TSIZE size = -1 ) { return T2String16::CopySafe( dst, src, size ); }
39 static const TWCHAR* String16FindChar( const TWCHAR* str, TWCHAR character ) { return T2String16::FindChar( str, character ); }
40 static const TWCHAR* String16FindString( const TWCHAR* str, TWCHAR* substr ) { return T2String16::FindString( str, substr ); }
41 static TSIZE String16Length( const TWCHAR* str ) { return T2String16::Length( str ); }
42
43 static void String16Format( TWCHAR* str, TINT size, const TWCHAR* format, ... )
44 {
45 va_list args;
46
47 va_start( args, format );
48
49 T2String16::FormatV( str, size, format, args );
50
51 va_end( args );
52 }
53
54 static TWCHAR* StringCharToUnicode( TWCHAR* a_UnicodeString, const TCHAR* a_CharString, TUINT32 a_iLength );
55 static TCHAR* StringUnicodeToChar( TCHAR* a_CharString, const TWCHAR* const& a_UnicodeString, TUINT32 a_iLength );
56};
57
#define TOSHI_NAMESPACE_START
Definition Defines.h:47
#define TOSHI_NAMESPACE_END
Definition Defines.h:50
wchar_t TWCHAR
Definition Typedefs.h:21
size_t TSIZE
Definition Typedefs.h:9
char TCHAR
Definition Typedefs.h:20
float TFLOAT
Definition Typedefs.h:4
uint32_t TUINT32
Definition Typedefs.h:13
int TINT
Definition Typedefs.h:7
static TWCHAR * FindString(TWCHAR *str, const TWCHAR *substr)
static TWCHAR * Copy(TWCHAR *dst, const TWCHAR *src, TSIZE size=-1)
static TWCHAR ms_aScratchMem[SCRATCH_MEM_SIZE]
Definition T2String16.h:61
static TINT FormatV(TWCHAR *a_pcString, TINT size, const TWCHAR *a_pcFormat, va_list args)
static TWCHAR * CopySafe(TWCHAR *dst, const TWCHAR *src, TSIZE size)
static TSIZE Length(const TWCHAR *str)
static TINT CompareNoCase(const TWCHAR *str1, const TWCHAR *str2, TSIZE size=-1)
static TINT Compare(const TWCHAR *str1, const TWCHAR *str2, TSIZE size=-1)
static TWCHAR * FindChar(TWCHAR *str, TWCHAR character)
static TCHAR * FindChar(TCHAR *str, TCHAR character)
static TSIZE Length(const TCHAR *str)
static TCHAR ms_aScratchMem[SCRATCH_MEM_SIZE]
Definition T2String8.h:61
static TINT FormatV(TCHAR *a_pcString, TINT size, const TCHAR *a_pcFormat, va_list args)
Definition T2String8.cpp:22
static TFLOAT StringToFloat(const TCHAR *src)
static void ToLowerCase(TCHAR *str)
static TCHAR * CopySafe(TCHAR *dst, const TCHAR *src, TSIZE size)
Definition T2String8.cpp:84
static TINT Compare(const TCHAR *str1, const TCHAR *str2, TSIZE size=-1)
Definition T2String8.cpp:52
static TINT CompareNoCase(const TCHAR *str1, const TCHAR *str2, TSIZE size=-1)
Definition T2String8.cpp:60
static TCHAR * Copy(TCHAR *dst, const TCHAR *src, TSIZE size=-1)
Definition T2String8.cpp:68
static TCHAR * FindString(TCHAR *str, const TCHAR *substr)
static void String8ToLowerCase(TCHAR *str)
static TWCHAR * StringCharToUnicode(TWCHAR *a_UnicodeString, const TCHAR *a_CharString, TUINT32 a_iLength)
static TINT String8Compare(const TCHAR *str1, const TCHAR *str2, TSIZE size=-1)
static TFLOAT String8ToFloat(const TCHAR *str)
static TCHAR * String8CopySafe(TCHAR *dst, const TCHAR *src, TSIZE size=-1)
static TSIZE String8Length(const TCHAR *str)
static const TCHAR * String8FindChar(const TCHAR *str, TCHAR character)
static TCHAR * GetTempString8()
static TINT String8CompareNoCase(const TCHAR *str1, const TCHAR *str2, TSIZE size=-1)
static TINT String16CompareNoCase(const TWCHAR *str1, const TWCHAR *str2, TSIZE size=-1)
static const TWCHAR * String16FindChar(const TWCHAR *str, TWCHAR character)
static TWCHAR * String16Copy(TWCHAR *dst, const TWCHAR *src, TSIZE size=-1)
static void String8Format(TCHAR *str, TINT size, const TCHAR *format,...)
static void String16Format(TWCHAR *str, TINT size, const TWCHAR *format,...)
static const TCHAR * String8FindString(const TCHAR *str, const TCHAR *substr)
static TWCHAR * String16CopySafe(TWCHAR *dst, const TWCHAR *src, TSIZE size=-1)
static TSIZE String16Length(const TWCHAR *str)
static TWCHAR * GetTempString16()
static const TWCHAR * String16FindString(const TWCHAR *str, TWCHAR *substr)
static TCHAR * String8Copy(TCHAR *dst, const TCHAR *src, TSIZE size=-1)
static TCHAR * StringUnicodeToChar(TCHAR *a_CharString, const TWCHAR *const &a_UnicodeString, TUINT32 a_iLength)
static TINT String16Compare(const TWCHAR *str1, const TWCHAR *str2, TSIZE size=-1)