#include <string.hpp>
|
| string_rep () |
|
| string_rep (int n) |
|
| ~string_rep () |
|
int | expand_or_shrink_by (int delta) |
| expand (or shrink) string by delta, but do not release memory when string is shrinked.
|
|
void | resize (int n) |
| expand (or shrink) string to given length n, and try to release memory when string is shrinked.
|
|
void | reserve (int n) |
| reserve memory space to contain at least n word in the whole string. Do not affect length of string, and do not release memory when n is smaller than current space.
|
|
|
| concrete_struct () |
| Default constructor for the concrete object. Increments the reference count.
|
|
virtual | ~concrete_struct () |
| Virtual destructor for the concrete object. Decrements the reference count.
|
|
Definition at line 24 of file string.hpp.
◆ string_rep() [1/2]
string_rep::string_rep |
( |
| ) |
|
|
inline |
Definition at line 30 of file string.hpp.
The list class represents a linked list.
◆ string_rep() [2/2]
string_rep::string_rep |
( |
int | n | ) |
|
Definition at line 34 of file string.cpp.
37 }
38}
int round_length(int n, size_t s)
◆ ~string_rep()
string_rep::~string_rep |
( |
| ) |
|
|
inline |
Definition at line 32 of file string.hpp.
32 {
34 }
void tm_delete_array(C *Ptr)
◆ expand_or_shrink_by()
int string_rep::expand_or_shrink_by |
( |
int | delta | ) |
|
expand (or shrink) string by delta, but do not release memory when string is shrinked.
- Returns
- string length before expansion
Definition at line 65 of file string.cpp.
65 {
70}
void reserve(int n)
reserve memory space to contain at least n word in the whole string. Do not affect length of string,...
url delta(url base, url u)
◆ resize()
void string_rep::resize |
( |
int | n | ) |
|
expand (or shrink) string to given length n, and try to release memory when string is shrinked.
- Note
- expand_or_shrink_by may be faster if memory space is reserved
Definition at line 41 of file string.cpp.
41 {
49 }
50 else {
53 }
54 }
59 };
60 }
62}
◆ reserve()
void string_rep::reserve |
( |
int | n | ) |
|
reserve memory space to contain at least n word in the whole string. Do not affect length of string, and do not release memory when n is smaller than current space.
Definition at line 73 of file string.cpp.
73 {
79 }
83 }
84 }
85 else {
90 };
91 }
92}
◆ string
◆ a_N
The documentation for this class was generated from the following files: