From 325530e630c68c7c10a2f4339f5b43434fcd0329 Mon Sep 17 00:00:00 2001 From: sc Date: Tue, 28 Nov 2000 14:19:35 +0000 Subject: Incorporation into IvyLeague Ccu -> Ivl ccu -> ivl Smart pointers disappear (too dangerous) Imakefile disappears (Makefile now) An empty cplus_bugs.h has been created locally --- utils/String.cc | 73 +++++++++++++++++++++++++++------------------------------ 1 file changed, 34 insertions(+), 39 deletions(-) (limited to 'utils/String.cc') diff --git a/utils/String.cc b/utils/String.cc index f6b7e4a..cd5b52d 100644 --- a/utils/String.cc +++ b/utils/String.cc @@ -35,7 +35,6 @@ NewString (const char* s) return p; } - /*? Allocate a string of \var{n} characters, copy the \var{n} first characters of \var{s} in it, @@ -74,7 +73,6 @@ NewString (int n) return new char [n+1]; } - /*? Free a string which has previously been allocated with \fun{NewString}. @@ -92,64 +90,64 @@ FreeString (char* s) #endif } -/*?class CcuString +/*?class IvlString ?*/ #ifdef DOC /*? -Build an empty \typ{CcuString}. +Build an empty \typ{IvlString}. ?*/ -CcuString :: CcuString () +IvlString :: IvlString () { } #endif /*? -Build a \typ{CcuString} from \var{s}. \var{s} can be null. +Build a \typ{IvlString} from \var{s}. \var{s} can be null. ?*/ -CcuString :: CcuString (const char* s) +IvlString :: IvlString (const char* s) : Str (NewString (s)) { } /*? -Build a \typ{CcuString} from the \var{n} first characters of \var{s}. \var{s} can be null. +Build a \typ{IvlString} from the \var{n} first characters of \var{s}. \var{s} can be null. If it is shorter than \var{n} characters, the new string is padded with null characters. ?*/ -CcuString :: CcuString (const char* s, int n) +IvlString :: IvlString (const char* s, int n) : Str (NewString (s, n)) { } /*? -Create a \typ{CcuString} suitable for storing at most \var{n} characters, and +Create a \typ{IvlString} suitable for storing at most \var{n} characters, and initialize it to the null string. ?*/ -CcuString :: CcuString (int n) +IvlString :: IvlString (int n) : Str (NewString (n)) { *Str = '\0'; } /*? -Create a new \typ{CcuString} by copying \var{s}. +Create a new \typ{IvlString} by copying \var{s}. ?*/ -CcuString :: CcuString (const CcuString& s) +IvlString :: IvlString (const IvlString& s) : Str (NewString (s)) { } /*? -Create a new \typ{CcuString} by copying \var{s}. +Create a new \typ{IvlString} by copying \var{s}. ?*/ -CcuString :: CcuString (const CcuShadowString& s) +IvlString :: IvlString (const IvlShadowString& s) { Str = NewString (s); } /*?nodoc?*/ -CcuString :: ~CcuString () +IvlString :: ~IvlString () { if (Str) FreeString (Str); @@ -159,18 +157,16 @@ CcuString :: ~CcuString () /*? Return the value of a string. ?*/ -CcuString :: operator const char* () const +IvlString :: operator const char* () const { } #endif - - /*? Copy \var{s} into this string. The old string is freed. ?*/ -CcuString& -CcuString :: operator = (const CcuString& s) +IvlString& +IvlString :: operator = (const IvlString& s) { if (this != &s) { FreeString (Str); @@ -179,8 +175,8 @@ CcuString :: operator = (const CcuString& s) return *this; } -CcuString& -CcuString :: operator = (const char* s) +IvlString& +IvlString :: operator = (const char* s) { if (Str != s) { FreeString (Str); @@ -189,8 +185,8 @@ CcuString :: operator = (const char* s) return *this; } -CcuString& -CcuString :: operator = (const CcuShadowString& s) +IvlString& +IvlString :: operator = (const IvlShadowString& s) { if (Str != (const char*) (s)) { FreeString (Str); @@ -205,8 +201,8 @@ Assign to a string the \var{n} first characters of \var{s}. If it is shorter than \var{n} characters, the new string is padded with null characters. ?*/ -CcuString& -CcuString :: Assign (const char* s, int n) +IvlString& +IvlString :: Assign (const char* s, int n) { if (Str != s) { FreeString (Str); @@ -219,16 +215,16 @@ CcuString :: Assign (const char* s, int n) Compute the length of a string. ?*/ int -CcuString :: Length () const +IvlString :: Length () const { return strlen (Str); } #ifdef DOC /*? -Build an empty \typ{CcuShadowString}. +Build an empty \typ{IvlShadowString}. ?*/ -CcuShadowString :: CcuShadowString () +IvlShadowString :: IvlShadowString () { Str = 0; } @@ -236,36 +232,35 @@ CcuShadowString :: CcuShadowString () /*? ?*/ -CcuShadowString :: CcuShadowString (const char* s) +IvlShadowString :: IvlShadowString (const char* s) { Str = s; } /*? -Create a new \typ{CcuShadowString} by referencing \var{s}. +Create a new \typ{IvlShadowString} by referencing \var{s}. ?*/ -CcuShadowString :: CcuShadowString (const CcuString& s) +IvlShadowString :: IvlShadowString (const IvlString& s) { Str = (const char*) s; } #ifdef DOC -CcuShadowString& -CcuShadowString :: operator = (const CcuString& s) +IvlShadowString& +IvlShadowString :: operator = (const IvlString& s) { } -CcuShadowString& -CcuShadowString :: operator = (const char* s) +IvlShadowString& +IvlShadowString :: operator = (const char* s) { } /*? Return the value of a string. ?*/ -CcuShadowString :: operator const char* () const +IvlShadowString :: operator const char* () const { } #endif - -- cgit v1.1