Set this string's data to the specified character array. If |copy| is true this class will copy the data. Otherwise, this class will reference the existing data. Referenced data must exist for the lifetime of this class and will not be freed by this class.
| 532 | // and will not be freed by this class. |
| 533 | /// |
| 534 | bool FromString(const char_type* src, size_t src_len, bool copy) { |
| 535 | if (src == NULL || src_len == 0) { |
| 536 | clear(); |
| 537 | return true; |
| 538 | } |
| 539 | AllocIfNeeded(); |
| 540 | return traits::set(src, src_len, string_, copy) ? true : false; |
| 541 | } |
| 542 | |
| 543 | /// |
| 544 | // Set this string's data from an existing ASCII string. Data will be always |