|  |  | 
 |  |  |         p->initial(); | 
 |  |  |         p->flag = kUTF16 | kShouldFree; | 
 |  |  |         p->m_len = len; | 
 |  |  |         nstring::toWStr(value,p->alloc(p->m_len+1),p->m_len+1); | 
 |  |  |         p->m_val = p->alloc(p->m_len + 1); | 
 |  |  |         nstring::toWStr(value,p->m_val,p->m_len+1); | 
 |  |  |         return p; | 
 |  |  |     } | 
 |  |  |      | 
 |  |  | 
 |  |  |         p->initial(); | 
 |  |  |         p->flag = kUTF16 | kShouldFree; | 
 |  |  |         p->m_len = len; | 
 |  |  |         nstring::toWStr(value,p->alloc(p->m_len+1),p->m_len+1); | 
 |  |  |         p->m_val = p->alloc(p->m_len + 1); | 
 |  |  |         nstring::toWStr(value,p->m_val,p->m_len+1); | 
 |  |  |         return p; | 
 |  |  |     } | 
 |  |  | public: | 
 |  |  | 
 |  |  |     if(rhs.data)((KStringBlock<wchar_t>*)rhs.data)->AddRef(); | 
 |  |  | } | 
 |  |  |  | 
 |  |  |  | 
 |  |  | xstring::xstring(wchar_t* val, bool shouldSysFree) :data(KStringBlock<wchar_t>::make(val,shouldSysFree)) | 
 |  |  | { | 
 |  |  |  | 
 |  |  | 
 |  |  | { | 
 |  |  |  | 
 |  |  | } | 
 |  |  | xstring::xstring(LPARAM val, bool bdata) :data(bdata?(void*)val:(KStringBlock<wchar_t>::make(val))) | 
 |  |  | { | 
 |  |  |     if (bdata) | 
 |  |  |     { | 
 |  |  |         ((KStringBlock<wchar_t>*)data)->AddRef(); | 
 |  |  |     } | 
 |  |  | } | 
 |  |  |  | 
 |  |  | xstring::xstring(double val):data((KStringBlock<wchar_t>::make(val))) | 
 |  |  | { | 
 |  |  |  | 
 |  |  | } | 
 |  |  | xstring::xstring(LPARAM val):data((KStringBlock<wchar_t>::make(val))) | 
 |  |  | { | 
 |  |  |  | 
 |  |  | } | 
 |  |  |  | 
 |  |  | xstring::~xstring() | 
 |  |  | { | 
 |  |  | 
 |  |  | xstring& xstring::operator =(const xstring& rhs)  | 
 |  |  | { | 
 |  |  |     if (data)((KStringBlock<wchar_t>*)data)->Release(); | 
 |  |  |     ((KStringBlock<wchar_t>*)rhs.data)->AddRef(); | 
 |  |  |     data = rhs.data; | 
 |  |  |     if (rhs.data) | 
 |  |  |     { | 
 |  |  |         ((KStringBlock<wchar_t>*)rhs.data)->AddRef(); | 
 |  |  |         data = rhs.data; | 
 |  |  |     } | 
 |  |  |     else | 
 |  |  |         data = nullptr; | 
 |  |  |    return *this; | 
 |  |  | } | 
 |  |  | xstring& xstring::operator =(const wchar_t* rhs) | 
 |  |  | 
 |  |  |  | 
 |  |  | xstring::operator bool() | 
 |  |  | { | 
 |  |  |     return this->isEmpty(); | 
 |  |  |     return !this->isEmpty(); | 
 |  |  | } | 
 |  |  |  | 
 |  |  | const wchar_t* xstring::c_str(bool bclone) const{ | 
 |  |  | 
 |  |  |     return false; | 
 |  |  | } | 
 |  |  |  | 
 |  |  | xstring xstring::replace(wchar_t* from, wchar_t* to, int pos) | 
 |  |  | xstring xstring::replace(const wchar_t* from, const wchar_t* to) | 
 |  |  | { | 
 |  |  |     return replace(from, to, 0); | 
 |  |  | } | 
 |  |  | xstring xstring::replace(const wchar_t* from, const wchar_t* to, int pos) | 
 |  |  | { | 
 |  |  |     const wchar_t* pstr = c_str(); | 
 |  |  |     if (!pstr) return 0; |