next up previous contents
Next: Methods Up: Constructors Previous: Constructors   Contents

CifString

NAME

CifString

PROTOTYPE

#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);

EXAMPLE

#include "CifString.h"

CifString *a1 = new CifString();
CifString *a2 = new CifString("AAA");
CifString *a3 = new CifString(a3);
PURPOSE

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.

RECEIVES

CifString(unsigned, int)
n allocated length
gb reallocation inctement

CifString(const char *, int)
s the string copied into the CifString
gb reallocation inctement

CifString(const char *, unsigned, int)
s the string copied into the CifString
n allocated length
gb reallocation inctement

CifString(const CifString &)
s the CifString

CifString(const CifString &, unsigned, unsigned, int)
s the CifString copied
ofs ofset where to start copying the CifString
n allocated length
gb reallocation inctement

RETURN VALUE

None

REMARKS

CifString::defsize and CifString::definc are internally defined constants, a both of them have value 16.

Allocation may fail, with string being null.


next up previous contents
Next: Methods Up: Constructors Previous: Constructors   Contents
Olivera Tosic 2002-06-12