NAME
OTC_CString -
Allows exact length raw strings to be created.
SYNOPSIS
#include <OTC/text/cstring.hh>
class OTC_CString
{
public:
virtual ~OTC_CString();
OTC_CString(char const* theString=0);
OTC_CString(char theChar, u_int theNum=1);
OTC_CString(char const* theString, u_int theNum);
friend ostream& operator<<(
ostream& outs,
OTC_CString const& theString
);
};
CLASS TYPE
Concrete
DESCRIPTION
OTC_CString provides a mechanism for creating raw strings
which use only the amount of memory which is required for
the string. OTC_CString should be used when creating
constant strings.
INITIALISATION
OTC_CString(char const* theString=0);
Creates a copy of theString. Only
uses enough memory to hold the string.
OTC_CString(char theChar, u_int theNum=1);
Creates a string holding theNum
instances of theChar. Only uses enough
memory to hold the string.
OTC_CString(char const* theString, u_int theNum);
Creates a copy of the first theNum
characters of theString. only
uses enough memory to hold the string.
Raises an exception if theString is
0 but theLength is greater than 0.
STREAMS OUTPUT
friend ostream& operator<<(
ostream& outs,
OTC_CString const& theString
);
Dumps theString to the stream outs.
Width and justification specifications are
honoured.
SEE ALSO
OTC_String, OTC_RString
LIBRARY
OTC
AUTHOR(S)
Graham Dumpleton
COPYRIGHT
Copyright 1994 TELSTRA CORPORATION LIMITED
Copyright 1994 DUMPLETON SOFTWARE CONSULTING PTY LIMITED