CifString
#include "CifString.h" CifString(unsigned n = CifString::defsize, int gb = CifString::definc); CifString(const char *s, int gb = CifString::definc); CifString(const char *s, unsigned n, int gb = CifString::definc); CifString(const CifString &s); CifString(const CifString &s, unsigned ofs, unsigned n, int gb = CifString::definc);
#include "CifString.h" CifString *a1 = new CifString(); CifString *a2 = new CifString("AAA"); CifString *a3 = new CifString(a3);
CifString(unsigned, int) Constructor to allocate a string of allocated length of n, and a reallocation increment of gb.
CifString(const char *, int) Create a string copying bytes from a null-terminated array s, with a reallocation increment of gb. If gb is not zero, the initial allocated length will be the next multiple of gb 1#1 length of s. This allows the string to grow a little without needing reallocation.
CifString(const char *, unsigned, int) Create a string of allocated length n,reallocation increment of gb, copying bytes from s.
CifString(const CifString &) Copy constructor, which uses share semantics.
CifString(const CifString &, unsigned, unsigned, int) A constructor to create a substring of string s. The substring shares it's data with this string, starting at offset ofs, and of length n. It has reallocation inctement of gb.
n | allocated length |
gb | reallocation inctement |
s | the string copied into the CifString |
gb | reallocation inctement |
s | the string copied into the CifString |
n | allocated length |
gb | reallocation inctement |
s | the CifString |
s | the CifString copied |
ofs | ofset where to start copying the CifString |
n | allocated length |
gb | reallocation inctement |
None
CifString::defsize and CifString::definc are internally defined constants, a both of them have value 16.
Allocation may fail, with string being null.