1
0
forked from 0ad/0ad

Added CStr constructor for non-NULL-terminated char*s

This was SVN commit r1095.
This commit is contained in:
Ykkrosh 2004-09-01 19:48:51 +00:00
parent 18fea5478f
commit 29e0bfea5b
2 changed files with 9 additions and 2 deletions

View File

@ -29,10 +29,16 @@ CStr::CStr(const CStr& Str)
CStr::CStr(const TCHAR* String)
{
// Creates CStr from C-Style TCHAR string
// Creates CStr from null-terminated C-Style TCHAR string
m_String = String;
}
CStr::CStr(const TCHAR* String, size_t Length)
{
// Creates CStr from TCHAR string of specified length
m_String = tstring(String, Length);
}
CStr::CStr(tstring String)
{
m_String = String;

View File

@ -120,7 +120,8 @@ public:
#if !(defined(_MSC_VER) && defined(_UNICODE))
CStr(utf16string String); // Creates CStr from UTF16 string, potentially losing data in UTF16->ASCII conversions
#endif
CStr(const TCHAR* String); // Creates CStr from C-Style TCHAR string
CStr(const TCHAR* String); // Creates CStr from null-terminated C-Style TCHAR string
CStr(const TCHAR* String, size_t Length); // Creates CStr from TCHAR string of specified length
CStr(TCHAR Char); // Creates CStr from a TCHAR
CStr(int Number); // Creates CStr from a int
CStr(unsigned int Number); // Creates CStr from a uint