/* ECP: FILEname=fig14_19.cpp */ /* 1*/ inline void /* 2*/ String::GetStorage( const unsigned int MaxLength ) /* 3*/ { /* 4*/ StorageLen = MaxLength + 1; /* 5*/ Storage = new char [ StorageLen ]; /* 6*/ if( Storage == NULL ) /* 7*/ Error( "Out of space" ); /* 8*/ } /* 1*/ String::String( const char * Value ) /* 2*/ { /* 3*/ const char * TheValue = Value ? Value : ""; /* 4*/ GetStorage( strlen( TheValue ) ); /* 5*/ strcpy( Storage, TheValue ); /* 6*/ } /* 1*/ String::String( const String & Value ) /* 2*/ { /* 3*/ GetStorage( strlen( Value.Storage ) ); /* 4*/ strcpy( Storage, Value.Storage ); /* 5*/ }