2020-03-11 15:23:58 +01:00
|
|
|
////*************************************************************************************************
|
|
|
|
////*************************************************************************************************
|
|
|
|
////
|
|
|
|
//// STRING
|
|
|
|
////
|
|
|
|
//// Developed by jief666, from 1997.
|
|
|
|
////
|
|
|
|
////*************************************************************************************************
|
|
|
|
////*************************************************************************************************
|
|
|
|
//
|
|
|
|
//#if 0
|
|
|
|
//#define DBG(...) DebugLog(2, __VA_ARGS__)
|
|
|
|
//#else
|
|
|
|
//#define DBG(...)
|
|
|
|
//#endif
|
|
|
|
//
|
|
|
|
//#include "XToolsCommon.h"
|
|
|
|
//#include "XUINTN.h"
|
|
|
|
//
|
|
|
|
////xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
|
|
//// Constructor
|
|
|
|
////xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
|
|
//
|
|
|
|
//XStringW::XStringW()
|
|
|
|
//{
|
|
|
|
//DBG("Construteur\n");
|
|
|
|
// Init();
|
|
|
|
//}
|
|
|
|
//
|
|
|
|
//XStringW::XStringW(const XStringW &aString)
|
|
|
|
//{
|
2020-03-25 19:32:44 +01:00
|
|
|
//DBG("Constructor(const XStringW &aString) : %ls\n", aString.data());
|
2020-03-11 15:23:58 +01:00
|
|
|
// Init(aString.length());
|
|
|
|
// StrnCpy(aString.data(), aString.length());
|
|
|
|
//}
|
|
|
|
////
|
|
|
|
////XStringW::XStringW(const wchar_t *S)
|
|
|
|
////{
|
|
|
|
//// if ( !S ) {
|
|
|
|
//// DebugLog(2, "XStringW(const wchar_t *S) called with NULL. Use setEmpty()\n");
|
|
|
|
//// panic();
|
|
|
|
//// }
|
2020-03-25 19:32:44 +01:00
|
|
|
////DBG("Constructor(const wchar_t *S) : %ls, StrLen(S)=%d\n", S, StrLen(S));
|
2020-03-11 15:23:58 +01:00
|
|
|
//// Init(StrLen(S));
|
|
|
|
//// StrCpy(S);
|
|
|
|
////}
|
|
|
|
////
|
|
|
|
////XStringW::XStringW(const wchar_t *S, UINTN count)
|
|
|
|
////{
|
2020-03-25 19:32:44 +01:00
|
|
|
////DBG("Constructor(const wchar_t *S, UINTN count) : %ls, %d\n", S, count);
|
2020-03-11 15:23:58 +01:00
|
|
|
//// Init(count);
|
|
|
|
//// StrnCpy(S, count);
|
|
|
|
////}
|
|
|
|
////
|
|
|
|
////XStringW::XStringW(const wchar_t aChar)
|
|
|
|
////{
|
|
|
|
////DBG("Constructor(const wchar_t aChar)\n");
|
|
|
|
//// Init(1);
|
|
|
|
//// StrnCpy(&aChar, 1);
|
|
|
|
////}
|
|
|
|
////
|
|
|
|
////XStringW::XStringW(const char* S)
|
|
|
|
////{
|
|
|
|
////DBG("Constructor(const char* S)\n");
|
|
|
|
//// xsize newLen = StrLenInWChar(S, AsciiStrLen(S));
|
|
|
|
//// Init(newLen);
|
|
|
|
//// utf8ToWChar(m_data, m_allocatedSize+1, S, AsciiStrLen(S)); // m_size doesn't count the NULL terminator
|
|
|
|
//// SetLength(newLen);
|
|
|
|
////}
|
|
|
|
//
|
|
|
|
//const XStringW& XStringW::takeValueFrom(const wchar_t* S)
|
|
|
|
//{
|
|
|
|
// if ( !S ) {
|
|
|
|
// DebugLog(2, "takeValueFrom(const wchar_t* S) called with NULL. Use setEmpty()\n");
|
|
|
|
// panic();
|
|
|
|
// }
|
|
|
|
// Init(StrLen(S));
|
|
|
|
// StrCpy(S);
|
|
|
|
// return *this;
|
|
|
|
//}
|
|
|
|
//
|
|
|
|
//const XStringW& XStringW::takeValueFrom(const char* S)
|
|
|
|
//{
|
|
|
|
// UINTN asciiStrLen = AsciiStrLen(S);
|
|
|
|
// xsize newLen = StrLenInWChar(S, asciiStrLen);
|
|
|
|
// Init(newLen);
|
|
|
|
// utf8ToWChar(m_data, m_allocatedSize+1, S, asciiStrLen); // m_size doesn't count the NULL terminator
|
|
|
|
// SetLength(newLen);
|
|
|
|
// return *this;
|
|
|
|
//}
|
|
|
|
//
|
|
|
|
////xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|
|
|
|
////
|
|
|
|
////xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
|