92class CLASS_DECL_ACME wstring :
97 static const ::i32 npos;
98 typedef wstring_manager manager;
99 typedef unichar value_type;
100 typedef wstring_data data_type;
124 wstring(for_moving) {};
125 wstring(manager * pstringmanager);
126 void construct(manager * pstringmanager =
nullptr);
127 wstring(
const wstring & strSrc,manager * pstringmanager =
nullptr);
128 wstring(const ::scoped_string & scopedstrSrc,manager * pstringmanager =
nullptr);
129 wstring(const ::u8 * pszSrc,manager * pstringmanager =
nullptr);
130 wstring(const ::u8 * pszSrc, character_count nLength, manager * pstringmanager =
nullptr);
131 wstring(
const wide_character * pchSrc, manager * pstringmanager =
nullptr);
132 wstring(
const wide_character * pchSrc, character_count nLength,manager * pstringmanager =
nullptr);
133 inline wstring(
const wstring_data * pdata,manager * pstringmanager =
nullptr)
135 __UNREFERENCED_PARAMETER(pstringmanager);
136 m_pwsz = (wide_character * ) &pdata->m_wchFirst;
141 inline void attach(wstring_data * pdata)
143 if(m_pwsz !=
nullptr)
145 wstring_data::_free(m_pwsz);
147 m_pwsz = &pdata->m_wchFirst;
150 inline wstring_data * detach()
152 wstring_data * pdata = get_data();
153 m_pwsz = wstring_data::get_nil();
158 void reserve(character_count n) { __UNREFERENCED_PARAMETER(n); }
160 wstring & operator = (
const wstring & wstr);
161 wstring & operator = (
const wide_character * pwsz);
162 wstring & operator = (const ::scoped_string & scopedstr);
165 inline operator const wide_character * ()
const {
return get_data()->m_iAllocation <= 0 ? wstring_data::get_nil() : m_pwsz; }
166 inline operator const wide_character * () {
return get_data()->m_iAllocation <= 0 ? wstring_data::get_nil() : m_pwsz; }
168 inline operator wide_character * ()
const {
return get_data()->m_iAllocation <= 0 ? wstring_data::get_nil() : m_pwsz; }
169 inline operator wide_character * () {
return get_data()->m_iAllocation <= 0 ? wstring_data::get_nil() : m_pwsz; }
172 inline const wide_character * c_str()
const {
return this->
operator const wide_character * (); }
174#if defined(UNIVERSAL_WINDOWS) && defined(__cplusplus_winrt)
175 inline operator String ^ ()
const {
return ref aaa_primitive_new String(
operator const wide_character * ()); }
176 inline operator String ^ () {
return ref aaa_primitive_new String(
operator const wide_character * ()); }
179 inline wstring & operator += (unichar wch) { append(wch);
return *
this; }
180 inline wstring & operator += (
const wide_character * pwsz) { append(pwsz);
return *
this; }
184 inline unichar operator [] (::collection::index iIndex)
const
186 return m_pwsz[iIndex];
189 inline unichar & operator [] (::collection::index iIndex)
191 return m_pwsz[iIndex];
194 wide_character * alloc(::collection::count iCount);
196 inline ::collection::count get_length()
const
198 return get_data()->m_iLength;
201 inline ::collection::count length()
const
203 return get_data()->m_iLength;
206 inline ::collection::count size()
const
208 return get_data()->m_iLength;
211 inline ::collection::count storage_size()
const
213 return get_data()->m_iAllocation;
216 inline ::collection::count allocation_size()
const
218 return get_data()->m_iAllocation;
221 inline ::collection::count get_storage_size()
const
223 return get_data()->m_iAllocation;
226 inline ::collection::count get_allocation_size()
const
228 return get_data()->m_iAllocation;
231 inline bool operator == (
const wide_character * pwsz)
const
233 return Compare(pwsz) == 0;
236 inline bool operator == (
const wstring & wstr)
const;
238 inline ::i32 Compare(
const wide_character * psz)
const
240 return wide_compare(m_pwsz, psz);
243 inline ::i32 Compare(
const wstring &str)
const
245 return wide_compare(m_pwsz, str);
248 inline ::i32 CompareNoCase(
const wide_character * psz)
const
250 return wide_compare_case_insensitive(m_pwsz, psz);
253 inline ::i32 CompareNoCase(
const wstring &str)
const
255 return wide_compare_case_insensitive(m_pwsz, str);
259 inline bool is_empty()
const
261 return get_data()->m_iLength <= 0 || *m_pwsz == L
'\0';
265 inline void set_length(::collection::count iLength)
268 if(iLength <= get_data()->m_iAllocation)
270 get_data()->m_iLength = iLength;
274 get_data()->m_iLength = 0;
276 m_pwsz[iLength] = L
'\0';
279 inline void release_buffer()
282 set_length(wide_length(m_pwsz));
287 inline static wstring empty_string()
293 inline wstring & append(unichar wch)
302 return *
this = (*
this + wsz);
306 inline wstring & append(unichar wch, ::collection::count c)
322 inline wstring & append(
const wide_character * pwsz) { assign(*
this + pwsz);
return *
this; }
324 wstring substr(::collection::index iStart, ::collection::count c = -1);
325 wstring & replace(::collection::index iStart,::collection::count c,
const wide_character * psz);
328 wstring & operator = (const ::scoped_string & scopedstr);
330 void assign(
const wide_character * pwsz);
331 void assign(const ::scoped_string & scopedstr);
334 character_count find(unichar ch,character_count start = 0,character_count count = -1)
const RELEASENOTHROW;
335 character_count find(
const wide_character * pszSub,character_count start = 0,character_count count = -1,
const wide_character * * pszTail =
nullptr)
const RELEASENOTHROW;
337 bool empty()
const {
return is_empty(); }