1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442
|
.TH ACE_WString 3 "1 Dec 2001" "ACE" \" -*- nroff -*-
.ad l
.nh
.SH NAME
ACE_WString \- This class provides a wrapper facade for C wide strings.
.SH SYNOPSIS
.br
.PP
\fC#include <SString.h>\fR
.PP
.SS Public Methods
.in +1c
.ti -1c
.RI "\fBACE_WString\fR (\fBACE_Allocator\fR *alloc = 0)"
.br
.RI "\fIDefault constructor.\fR"
.ti -1c
.RI "\fBACE_WString\fR (const char *s, \fBACE_Allocator\fR *alloc = 0)"
.br
.RI "\fIConstructor that copies <s> into dynamically allocated memory.\fR"
.ti -1c
.RI "\fBACE_WString\fR (const \fBACE_WSTRING_TYPE\fR *s, \fBACE_Allocator\fR *alloc = 0)"
.br
.RI "\fIConstructor that copies <s> into dynamically allocated memory.\fR"
.ti -1c
.RI "\fBACE_WString\fR (const \fBACE_USHORT16\fR *s, size_t len, \fBACE_Allocator\fR *alloc = 0)"
.br
.RI "\fIConstructor that takes in a ushort16 string (mainly used by the \fBACE\fR Name_Space classes).\fR"
.ti -1c
.RI "\fBACE_WString\fR (const \fBACE_WSTRING_TYPE\fR *s, size_t len, \fBACE_Allocator\fR *alloc = 0)"
.br
.RI "\fIConstructor that copies <len> ACE_WSTRING_TYPE's of <s> into dynamically allocated memory (will NUL terminate the result).\fR"
.ti -1c
.RI "\fBACE_WString\fR (size_t len, \fBACE_Allocator\fR *alloc = 0)"
.br
.RI "\fIConstructor that dynamically allocates memory for <len> + 1 ACE_WSTRING_TYPE characters. The newly created memory is set memset to 0.\fR"
.ti -1c
.RI "\fBACE_WString\fR (const ACE_WString &s)"
.br
.RI "\fICopy constructor.\fR"
.ti -1c
.RI "\fBACE_WString\fR (\fBACE_WSTRING_TYPE\fR c, \fBACE_Allocator\fR *alloc = 0)"
.br
.RI "\fIConstructor that copies <c> into dynamically allocated memory.\fR"
.ti -1c
.RI "\fB~ACE_WString\fR (void)"
.br
.RI "\fIDeletes the memory...\fR"
.ti -1c
.RI "\fBACE_WSTRING_TYPE\fR \fBoperator[]\fR (size_t slot) const"
.br
.RI "\fIReturn the <slot'th> character in the string (doesn't perform bounds checking).\fR"
.ti -1c
.RI "\fBACE_WSTRING_TYPE\fR& \fBoperator[]\fR (size_t slot)"
.br
.RI "\fIReturn the <slot'th> character by reference in the string (doesn't perform bounds checking).\fR"
.ti -1c
.RI "ACE_WString& \fBoperator=\fR (const ACE_WString &)"
.br
.RI "\fIAssignment operator(does copy memory).\fR"
.ti -1c
.RI "void \fBset\fR (const \fBACE_WSTRING_TYPE\fR *s)"
.br
.RI "\fICopy <s>.\fR"
.ti -1c
.RI "void \fBset\fR (const \fBACE_WSTRING_TYPE\fR *s, size_t len)"
.br
.RI "\fICopy <len> bytes of <s> (will NUL terminate the result).\fR"
.ti -1c
.RI "void \fBclear\fR ()"
.br
.RI "\fIClear this string.\fR"
.ti -1c
.RI "ACE_WString \fBsubstring\fR (size_t offset, \fBssize_t\fR length = -1) const"
.br
.ti -1c
.RI "ACE_WString \fBsubstr\fR (size_t offset, \fBssize_t\fR length = -1) const"
.br
.RI "\fISame as substring.\fR"
.ti -1c
.RI "ACE_WString& \fBoperator+=\fR (const ACE_WString &)"
.br
.RI "\fIConcat operator(does copy memory).\fR"
.ti -1c
.RI "ACE_WString& \fBoperator+=\fR (const \fBACE_WSTRING_TYPE\fR *)"
.br
.RI "\fIConcat operator(does copy memory).\fR"
.ti -1c
.RI "u_long \fBhash\fR (void) const"
.br
.RI "\fIReturns a hash value for this string.\fR"
.ti -1c
.RI "size_t \fBlength\fR (void) const"
.br
.RI "\fIReturn the length of the string.\fR"
.ti -1c
.RI "size_t \fBbuffer_size\fR (void) const"
.br
.RI "\fIReturn the size of the buffer.\fR"
.ti -1c
.RI "\fBACE_WSTRING_TYPE\fR* \fBrep\fR (void) const"
.br
.RI "\fIGets a copy of the underlying pointer.\fR"
.ti -1c
.RI "char* \fBchar_rep\fR (void) const"
.br
.RI "\fITransform into a copy of the ASCII character representation. (caller must delete).\fR"
.ti -1c
.RI "\fBACE_USHORT16\fR* \fBushort_rep\fR (void) const"
.br
.RI "\fITransform into a copy of a USHORT16 representation (caller must delete). Note, behavior is undefined when sizeof (wchar_t) != 2.\fR"
.ti -1c
.RI "const \fBACE_WSTRING_TYPE\fR* \fBfast_rep\fR (void) const"
.br
.RI "\fIGet at the underlying representation directly!\fR"
.ti -1c
.RI "const \fBACE_WSTRING_TYPE\fR* \fBc_str\fR (void) const"
.br
.RI "\fISame as STL String's <c_str> and <fast_rep>.\fR"
.ti -1c
.RI "int \fBstrstr\fR (const ACE_WString &s) const"
.br
.RI "\fIComparison operator that will match substrings. Returns the slot of the first location that matches, else -1.\fR"
.ti -1c
.RI "int \fBfind\fR (const ACE_WString &str, int pos = 0) const"
.br
.RI "\fIFind <str> starting at pos. Returns the slot of the first location that matches (will be >= pos), else npos.\fR"
.ti -1c
.RI "int \fBfind\fR (const \fBACE_WSTRING_TYPE\fR *s, int pos = 0) const"
.br
.RI "\fIFind <s> starting at pos. Returns the slot of the first location that matches (will be >= pos), else npos.\fR"
.ti -1c
.RI "int \fBfind\fR (\fBACE_WSTRING_TYPE\fR c, int pos = 0) const"
.br
.RI "\fIFind <c> starting at pos. Returns the slot of the first location that matches (will be >= pos), else npos.\fR"
.ti -1c
.RI "int \fBrfind\fR (\fBACE_WSTRING_TYPE\fR c, int pos = \fBnpos\fR) const"
.br
.RI "\fIFind <c> starting at pos (counting from the end). Returns the slot of the first location that matches, else npos.\fR"
.ti -1c
.RI "int \fBoperator==\fR (const ACE_WString &s) const"
.br
.RI "\fIEquality comparison operator(must match entire string).\fR"
.ti -1c
.RI "int \fBoperator<\fR (const ACE_WString &s) const"
.br
.RI "\fILess than comparison operator.\fR"
.ti -1c
.RI "int \fBoperator>\fR (const ACE_WString &s) const"
.br
.RI "\fIGreater than comparison operator.\fR"
.ti -1c
.RI "int \fBoperator!=\fR (const ACE_WString &s) const"
.br
.RI "\fIInequality comparison operator.\fR"
.ti -1c
.RI "int \fBcompare\fR (const ACE_WString &s) const"
.br
.RI "\fIPerforms a <strcmp>-style comparison.\fR"
.ti -1c
.RI "void \fBdump\fR (void) const"
.br
.RI "\fIDump the state of an object.\fR"
.ti -1c
.RI "void \fBresize\fR (size_t len)"
.br
.in -1c
.SS Public Attributes
.in +1c
.ti -1c
.RI "\fBACE_ALLOC_HOOK_DECLARE\fR"
.br
.RI "\fIDeclare the dynamic allocation hooks.\fR"
.in -1c
.SS Static Public Methods
.in +1c
.ti -1c
.RI "size_t \fBstrlen\fR (const \fBACE_WSTRING_TYPE\fR *)"
.br
.RI "\fIComputes the length of a "0" terminated ACE_WSTRING_TYPE *.\fR"
.ti -1c
.RI "const \fBACE_WSTRING_TYPE\fR* \fBstrstr\fR (const \fBACE_WSTRING_TYPE\fR *s1, const \fBACE_WSTRING_TYPE\fR *s2)"
.br
.RI "\fITraditional style strstr.\fR"
.in -1c
.SS Static Public Attributes
.in +1c
.ti -1c
.RI "const int \fBnpos\fR"
.br
.RI "\fINo position constant.\fR"
.in -1c
.SS Private Methods
.in +1c
.ti -1c
.RI "void \fBcheck_allocate\fR (size_t len)"
.br
.in -1c
.SS Private Attributes
.in +1c
.ti -1c
.RI "\fBACE_Allocator\fR* \fBallocator_\fR"
.br
.RI "\fIPointer to a memory allocator.\fR"
.ti -1c
.RI "size_t \fBbuf_len_\fR"
.br
.RI "\fISize of the buffer of the ACE_WString.\fR"
.ti -1c
.RI "size_t \fBlen_\fR"
.br
.RI "\fILength of the ACE_WString.\fR"
.ti -1c
.RI "\fBACE_WSTRING_TYPE\fR* \fBrep_\fR"
.br
.RI "\fIPointer to data.\fR"
.in -1c
.SS Static Private Attributes
.in +1c
.ti -1c
.RI "\fBACE_WSTRING_TYPE\fR \fBNULL_WString_\fR"
.br
.RI "\fIRepresents the "NULL" string to simplify the internal logic.\fR"
.in -1c
.SH DETAILED DESCRIPTION
.PP
This class provides a wrapper facade for C wide strings.
.PP
.PP
This class uses an to allocate memory. The user can make this a persistant class by providing an with a persistable memory pool. This class is optimized for efficiency, so it doesn't provide any internal locking.
.PP
.SH CONSTRUCTOR & DESTRUCTOR DOCUMENTATION
.PP
.SS ACE_WString::ACE_WString (\fBACE_Allocator\fR * alloc = 0)
.PP
Default constructor.
.PP
.SS ACE_WString::ACE_WString (const char * s, \fBACE_Allocator\fR * alloc = 0)
.PP
Constructor that copies <s> into dynamically allocated memory.
.PP
.SS ACE_WString::ACE_WString (const \fBACE_WSTRING_TYPE\fR * s, \fBACE_Allocator\fR * alloc = 0)
.PP
Constructor that copies <s> into dynamically allocated memory.
.PP
.SS ACE_WString::ACE_WString (const \fBACE_USHORT16\fR * s, size_t len, \fBACE_Allocator\fR * alloc = 0)
.PP
Constructor that takes in a ushort16 string (mainly used by the \fBACE\fR Name_Space classes).
.PP
.SS ACE_WString::ACE_WString (const \fBACE_WSTRING_TYPE\fR * s, size_t len, \fBACE_Allocator\fR * alloc = 0)
.PP
Constructor that copies <len> ACE_WSTRING_TYPE's of <s> into dynamically allocated memory (will NUL terminate the result).
.PP
.SS ACE_WString::ACE_WString (size_t len, \fBACE_Allocator\fR * alloc = 0)
.PP
Constructor that dynamically allocates memory for <len> + 1 ACE_WSTRING_TYPE characters. The newly created memory is set memset to 0.
.PP
.SS ACE_WString::ACE_WString (const ACE_WString & s)
.PP
Copy constructor.
.PP
.SS ACE_WString::ACE_WString (\fBACE_WSTRING_TYPE\fR c, \fBACE_Allocator\fR * alloc = 0)
.PP
Constructor that copies <c> into dynamically allocated memory.
.PP
.SS ACE_WString::~ACE_WString (void)
.PP
Deletes the memory...
.PP
.SH MEMBER FUNCTION DOCUMENTATION
.PP
.SS size_t ACE_WString::buffer_size (void) const
.PP
Return the size of the buffer.
.PP
.SS const \fBACE_WSTRING_TYPE\fR * ACE_WString::c_str (void) const
.PP
Same as STL String's <c_str> and <fast_rep>.
.PP
.SS char * ACE_WString::char_rep (void) const
.PP
Transform into a copy of the ASCII character representation. (caller must delete).
.PP
.SS void ACE_WString::check_allocate (size_t len)\fC [private]\fR
.PP
This method checks the size of the buffer. If the size of the buffer is not large enough the buffer will be resized. All new allocated space is zero'd out after this operation.
.SS void ACE_WString::clear ()
.PP
Clear this string.
.PP
.SS int ACE_WString::compare (const ACE_WString & s) const
.PP
Performs a <strcmp>-style comparison.
.PP
.SS void ACE_WString::dump (void) const
.PP
Dump the state of an object.
.PP
.SS const \fBACE_WSTRING_TYPE\fR * ACE_WString::fast_rep (void) const
.PP
Get at the underlying representation directly!
.PP
.SS int ACE_WString::find (\fBACE_WSTRING_TYPE\fR c, int pos = 0) const
.PP
Find <c> starting at pos. Returns the slot of the first location that matches (will be >= pos), else npos.
.PP
.SS int ACE_WString::find (const \fBACE_WSTRING_TYPE\fR * s, int pos = 0) const
.PP
Find <s> starting at pos. Returns the slot of the first location that matches (will be >= pos), else npos.
.PP
.SS int ACE_WString::find (const ACE_WString & str, int pos = 0) const
.PP
Find <str> starting at pos. Returns the slot of the first location that matches (will be >= pos), else npos.
.PP
.SS u_long ACE_WString::hash (void) const
.PP
Returns a hash value for this string.
.PP
.SS size_t ACE_WString::length (void) const
.PP
Return the length of the string.
.PP
.SS int ACE_WString::operator!= (const ACE_WString & s) const
.PP
Inequality comparison operator.
.PP
.SS ACE_WString & ACE_WString::operator+= (const \fBACE_WSTRING_TYPE\fR *)
.PP
Concat operator(does copy memory).
.PP
.SS ACE_WString & ACE_WString::operator+= (const ACE_WString &)
.PP
Concat operator(does copy memory).
.PP
.SS int ACE_WString::operator< (const ACE_WString & s) const
.PP
Less than comparison operator.
.PP
.SS ACE_WString & ACE_WString::operator= (const ACE_WString &)
.PP
Assignment operator(does copy memory).
.PP
.SS int ACE_WString::operator== (const ACE_WString & s) const
.PP
Equality comparison operator(must match entire string).
.PP
.SS int ACE_WString::operator> (const ACE_WString & s) const
.PP
Greater than comparison operator.
.PP
.SS \fBACE_WSTRING_TYPE\fR & ACE_WString::operator[] (size_t slot)
.PP
Return the <slot'th> character by reference in the string (doesn't perform bounds checking).
.PP
.SS \fBACE_WSTRING_TYPE\fR ACE_WString::operator[] (size_t slot) const
.PP
Return the <slot'th> character in the string (doesn't perform bounds checking).
.PP
.SS \fBACE_WSTRING_TYPE\fR * ACE_WString::rep (void) const
.PP
Gets a copy of the underlying pointer.
.PP
.SS void ACE_WString::resize (size_t len)
.PP
This method is designed for high-performance. Please use with care ;-) If the current size of the string is less than <len>, the string is resized to the new length. The data is zero'd out after this operation.
.SS int ACE_WString::rfind (\fBACE_WSTRING_TYPE\fR c, int pos = \fBnpos\fR) const
.PP
Find <c> starting at pos (counting from the end). Returns the slot of the first location that matches, else npos.
.PP
.SS void ACE_WString::set (const \fBACE_WSTRING_TYPE\fR * s, size_t len)
.PP
Copy <len> bytes of <s> (will NUL terminate the result).
.PP
.SS void ACE_WString::set (const \fBACE_WSTRING_TYPE\fR * s)
.PP
Copy <s>.
.PP
.SS size_t ACE_WString::strlen (const \fBACE_WSTRING_TYPE\fR *)\fC [static]\fR
.PP
Computes the length of a "0" terminated ACE_WSTRING_TYPE *.
.PP
.SS const \fBACE_WSTRING_TYPE\fR * ACE_WString::strstr (const \fBACE_WSTRING_TYPE\fR * s1, const \fBACE_WSTRING_TYPE\fR * s2)\fC [static]\fR
.PP
Traditional style strstr.
.PP
.SS int ACE_WString::strstr (const ACE_WString & s) const
.PP
Comparison operator that will match substrings. Returns the slot of the first location that matches, else -1.
.PP
.SS ACE_WString ACE_WString::substr (size_t offset, \fBssize_t\fR length = -1) const
.PP
Same as substring.
.PP
.SS ACE_WString ACE_WString::substring (size_t offset, \fBssize_t\fR length = -1) const
.PP
Return a substring given an offset and length, if length == -1 use rest of str return empty substring if offset or offset/length are invalid.
.SS \fBACE_USHORT16\fR * ACE_WString::ushort_rep (void) const
.PP
Transform into a copy of a USHORT16 representation (caller must delete). Note, behavior is undefined when sizeof (wchar_t) != 2.
.PP
.SH MEMBER DATA DOCUMENTATION
.PP
.SS ACE_WString::ACE_ALLOC_HOOK_DECLARE
.PP
Declare the dynamic allocation hooks.
.PP
.SS \fBACE_WSTRING_TYPE\fR ACE_WString::NULL_WString_\fC [static, private]\fR
.PP
Represents the "NULL" string to simplify the internal logic.
.PP
.SS \fBACE_Allocator\fR * ACE_WString::allocator_\fC [private]\fR
.PP
Pointer to a memory allocator.
.PP
.SS size_t ACE_WString::buf_len_\fC [private]\fR
.PP
Size of the buffer of the ACE_WString.
.PP
.SS size_t ACE_WString::len_\fC [private]\fR
.PP
Length of the ACE_WString.
.PP
.SS const int ACE_WString::npos\fC [static]\fR
.PP
No position constant.
.PP
.SS \fBACE_WSTRING_TYPE\fR * ACE_WString::rep_\fC [private]\fR
.PP
Pointer to data.
.PP
.SH AUTHOR
.PP
Generated automatically by Doxygen for ACE from the source code.
|