![]() |
Gray C++ Libraries
0.0.2
A set of C++ libraries for MSVC, GNU on Windows, WinCE, Linux
|
#include <cString.h>
Public Types | |
| typedef _TYPE_CH | CharType_t |
| ALA std::string::value_type. More... | |
Public Member Functions | |
| cStringT () noexcept | |
| cStringT (SUPER_t &str) noexcept | |
| cStringT (const char *pszText) | |
| cStringT (const char *pszText, StrLen_t iLenMax) | |
| cStringT (const wchar_t *pwText) | |
| cStringT (const wchar_t *pwText, StrLen_t iLenMax) | |
| const _TYPE_CH * | get_CPtr () const noexcept |
| bool | isPrintableString () const |
| bool | isValidString () const noexcept |
| bool | isValidCheck () const noexcept |
| bool | IsWhitespace () const |
| HRESULT | ReadZ (cStreamInput &File, StrLen_t iLenMax) |
| bool | WriteZ (cStreamOutput &File) const |
| HASHCODE_t | get_HashCode () const noexcept |
| size_t | GetHeapStats (OUT ITERATE_t &iAllocCount) const |
| int | get_RefCount () const |
| void | SetStringStatic () |
| StrLen_t | SetCodePage (const wchar_t *pwText, CODEPAGE_t uCodePage=CP_UTF8) |
| StrLen_t | GetCodePage (OUT wchar_t *pwText, StrLen_t iLenMax, CODEPAGE_t uCodePage=CP_UTF8) const |
| THIS_t | GetTrimWhitespace () const |
| HRESULT | SerializeInput (cStreamInput &File, StrLen_t iLenMax=StrT::k_LEN_MAX) |
| HRESULT | SerializeOutput (cStreamOutput &File) const |
| HRESULT | SerializeOutput (cArchive &a) const |
| HRESULT | Serialize (cArchive &a) |
| const THIS_t & | operator= (const THIS_t &s) |
| const THIS_t & | operator= (const char *pszStr) |
| const THIS_t & | operator= (const wchar_t *pwStr) |
| void | SetErase () |
| bool | Contains (const _TYPE_CH *pSubStr) |
| bool | ContainsI (const _TYPE_CH *pSubStr) |
| bool | StartsWithI (const _TYPE_CH *pSubStr) |
| bool | EndsWithI (const _TYPE_CH *pSubStr) const |
| const _TYPE_CH * | c_str () const |
| StrLen_t | size () const |
| StrLen_t | length () const |
| bool | empty () const |
| StrLen_t | find (_TYPE_CH ch) const |
| void | assign (const _TYPE_CH *pszStr, StrLen_t iLenCat) |
| void | append (const _TYPE_CH *pszStr, StrLen_t iLenCat) |
| void | push_back (_TYPE_CH ch) |
| void | resize (StrLen_t iSize) |
| void | reserve (StrLen_t iSize) |
| THIS_t | substr (StrLen_t nFirst, StrLen_t nCount=StrT::k_LEN_MAX) const |
| StrLen_t | SetCodePage (const wchar_t *pwStr, CODEPAGE_t uCodePage) |
| StrLen_t | SetCodePage (const wchar_t *pwStr, CODEPAGE_t uCodePage) |
| StrLen_t | GetCodePage (OUT wchar_t *pwText, StrLen_t iLenMax, CODEPAGE_t uCodePage) const |
| StrLen_t | GetCodePage (OUT wchar_t *pwText, StrLen_t iLenMax, CODEPAGE_t uCodePage) const |
Public Member Functions inherited from Gray::CStringT< char > | |
| CStringT () noexcept | |
| CStringT (const wchar_t *pwText) | |
| CStringT (const wchar_t *pwText, StrLen_t iLenMax) | |
| CStringT (const char *pszStr) | |
| CStringT (const char *pszStr, StrLen_t iLenMax) | |
| CStringT (const THIS_t &ref) noexcept | |
| CStringT (THIS_t &&ref) noexcept | |
| ~CStringT () | |
| CStringData * | GetData () const noexcept |
| const char * | GetString () const noexcept |
| bool | isValidString () const noexcept |
| bool | IsEmpty () const noexcept |
| StrLen_t | GetLength () const noexcept |
| void | Empty () |
| const char & | ReferenceAt (StrLen_t nIndex) const |
| char | GetAt (StrLen_t nIndex) const |
| void | SetAt (StrLen_t nIndex, char ch) |
| char * | GetBuffer (StrLen_t iMinLength) |
| void | ReleaseBuffer (StrLen_t nNewLength=k_StrLen_UNK) |
| const THIS_t & | operator= (const THIS_t &ref) |
| const THIS_t & | operator= (THIS_t &&ref) |
| const THIS_t & | operator= (const char *pStr) |
| const THIS_t & | operator= (const wchar_t *pStr) |
| void | AssignLenT (const char *pszStr, StrLen_t iLenMax) |
| void | AssignLen (const char *pszStr, StrLen_t iSizeMax=StrT::k_LEN_MAX) |
| void | AssignLen (const wchar_t *pwText, StrLen_t iSizeMax=StrT::k_LEN_MAX) |
| void | AssignLen (const wchar_t *pwStr, StrLen_t iLenMax) |
| void | AssignLen (const char *pszStr, StrLen_t iLenMax) |
| void | AssignLen (const char *pszStr, StrLen_t iLenMax) |
| void | AssignLen (const wchar_t *pwStr, StrLen_t iLenMax) |
| void | FormatV (const char *pszStr, va_list args) |
| void _cdecl | Format (const char *pszStr,...) |
| COMPARE_t | Compare (const char *pszStr) const |
| COMPARE_t | CompareNoCase (const char *pszStr) const |
| void | MakeUpper () |
| void | MakeLower () |
| THIS_t | Left (StrLen_t nCount) const |
| THIS_t | Right (StrLen_t nCount) const |
| THIS_t | Mid (StrLen_t nFirst, StrLen_t nCount=StrT::k_LEN_MAX) const |
| void | TrimRight () |
| void | TrimLeft () |
| StrLen_t | Find (char ch, StrLen_t nPosStart=0) const |
| char | operator[] (StrLen_t nIndex) const |
| const char & | operator[] (StrLen_t nIndex) |
| operator const char * () const | |
| StrLen_t | Insert (StrLen_t nIndex, char ch) |
| StrLen_t | Insert (StrLen_t nIndex, const char *pszStr, StrLen_t iLenCat) |
| StrLen_t | Insert (StrLen_t nIndex, const char *pszStr) |
| const THIS_t & | operator+= (char ch) |
| const THIS_t & | operator+= (const char *psz) |
| void | Assign (const THIS_t &str) |
| void | Assign (const wchar_t *pwText) |
| void | Assign (const char *pszStr) |
| void | Assign (const wchar_t *pwStr) |
| void | Assign (const char *pszStr) |
| void | Assign (const wchar_t *pwStr) |
| void | Assign (const char *pszStr) |
Static Public Member Functions | |
| static THIS_t _cdecl | GetFormatf (const _TYPE_CH *pszFormat,...) |
| static THIS_t __stdcall | GetErrorStringV (HRESULT nFormatID, void *pSource, va_list vargs) |
| static THIS_t __stdcall | GetErrorString (HRESULT nFormatID, void *pSource=nullptr) |
| static THIS_t _cdecl | GetErrorStringf (HRESULT nFormatID, void *pSource,...) |
| static THIS_t __stdcall | GetSizeK (UINT64 uVal, UINT nKUnit=1024, bool bSpace=false) |
Static Public Attributes | |
| static const int | npos = -1 |
Friends | |
| class | cStringTests |
Additional Inherited Members | |
Protected Member Functions inherited from Gray::CStringT< char > | |
| const char | m_Nil |
| const wchar_t | m_Nil |
| void | Init () noexcept |
| void | EmptyValid () |
| void | AssignFirst (const THIS_t &s) noexcept |
| void | AllocBuffer (StrLen_t iStrLength) |
| void | CopyBeforeWrite () |
Protected Attributes inherited from Gray::CStringT< char > | |
| char * | m_pchData |
Static Protected Attributes inherited from Gray::CStringT< char > | |
| static const char | m_Nil |
A string with added functions over the MFC CString core set. Use this for best string functionality.
| typedef _TYPE_CH Gray::cStringT< _TYPE_CH >::CharType_t |
ALA std::string::value_type.
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
|
inline |
iLenMax = _countof(StrT::k_LEN_MAX)-1 default. not including '\0' iLenMax = max chars, not including '\0' ! NOT sizeof() or _countof() like StrT::CopyLen
|
inline |
|
inline |
iLenMax = _countof(StrT::k_LEN_MAX)-1 default iLenMax = max chars, not including '\0' ! NOT sizeof() or _countof() like StrT::CopyLen
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
Get a hash code good on this machine alone. Must use something like StrT::GetHashCode32() for use on multiple machines or processes.
|
inline |
| StrLen_t Gray::cStringT< char >::GetCodePage | ( | OUT wchar_t * | pwText, |
| StrLen_t | iLenMax, | ||
| CODEPAGE_t | uCodePage | ||
| ) | const |
Convert char with CODEPAGE_t to UNICODE.
| StrLen_t Gray::cStringT< wchar_t >::GetCodePage | ( | OUT wchar_t * | pwText, |
| StrLen_t | iLenMax, | ||
| CODEPAGE_t | uCodePage | ||
| ) | const |
Just copy. No conversion if already UNICODE.
| StrLen_t Gray::cStringT< _TYPE_CH >::GetCodePage | ( | OUT wchar_t * | pwText, |
| StrLen_t | iLenMax, | ||
| CODEPAGE_t | uCodePage = CP_UTF8 |
||
| ) | const |
|
static |
hResError = HRESULT_WIN32_C(ERROR_INTERNAL_ERROR) etc.
|
static |
hResError = HRESULT_WIN32_C(ERROR_INTERNAL_ERROR) etc.
|
static |
Describe a system error code as a string. hResError = HRESULT_WIN32_C(ERROR_INTERNAL_ERROR) etc.
|
static |
Make a formatted string.
|
inline |
Get data allocations for all children. does not include sizeof(*this)
|
static |
| cStringT< _TYPE_CH > Gray::cStringT< _TYPE_CH >::GetTrimWhitespace |
Trim whitespace from both ends.
|
inline |
|
inlinenoexcept |
|
inlinenoexcept |
|
inline |
Like .NET String.IsNullOrWhitespace
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
| HRESULT Gray::cStringT< _TYPE_CH >::ReadZ | ( | cStreamInput & | File, |
| StrLen_t | iLenMax | ||
| ) |
Read in a new string from an open binary file. No length prefix.
|
inline |
|
inline |
| HRESULT Gray::cStringT< _TYPE_CH >::Serialize | ( | cArchive & | a | ) |
Serialize in either direction.
| HRESULT Gray::cStringT< _TYPE_CH >::SerializeInput | ( | cStreamInput & | File, |
| StrLen_t | iLenMax = StrT::k_LEN_MAX |
||
| ) |
Read in a new string from an open cStreamInput. CString Assume a size prefix. (in bytes not chars)
| HRESULT Gray::cStringT< _TYPE_CH >::SerializeOutput | ( | cArchive & | a | ) | const |
| HRESULT Gray::cStringT< _TYPE_CH >::SerializeOutput | ( | cStreamOutput & | File | ) | const |
Write a string AND length (in bytes not chars) out to the file.
| StrLen_t Gray::cStringT< char >::SetCodePage | ( | const wchar_t * | pwStr, |
| CODEPAGE_t | uCodePage | ||
| ) |
Convert UNICODE to CODEPAGE_t ASCII type string.
| StrLen_t Gray::cStringT< wchar_t >::SetCodePage | ( | const wchar_t * | pwStr, |
| CODEPAGE_t | uCodePage | ||
| ) |
Just copy. No conversion since its already UNICODE.
| StrLen_t Gray::cStringT< _TYPE_CH >::SetCodePage | ( | const wchar_t * | pwText, |
| CODEPAGE_t | uCodePage = CP_UTF8 |
||
| ) |
|
inline |
Clear this more thoroughly for security reasons. passwords, etc ZeroSecure ?
|
inline |
Make this string permanent. never removed from memory.
|
inline |
|
inline |
|
inline |
| bool Gray::cStringT< _TYPE_CH >::WriteZ | ( | cStreamOutput & | File | ) | const |
Write a string AND '\0' out to the file. No length prefix.
|
friend |
|
static |
emulate STL string operators. Is any of this needed ??