/* * CENA C++ Utilities * * by Stephane Chatty * * Copyright 1991, 1992 * Laboratoire de Recherche en Informatique (LRI) * Centre d'Etudes de la Navigation Aerienne (CENA) * * IvlString allocation and copying * * $Id$ * $CurLog$ */ #ifndef String_H_ #define String_H_ #include "cplus_bugs.h" /*? class StringMemory ?*/ extern char* NewString (const char*); extern char* NewString (const char*, int); extern char* NewString (int); extern void FreeString (char*); /*? end ?*/ class IvlShadowString; class IvlString { private: char* Str; public: inline IvlString () { Str = 0; } IvlString (const char*); IvlString (const char*, int); IvlString (int); IvlString (const IvlString&); IvlString (const IvlShadowString&); ~IvlString (); inline operator const char* () const { return Str; } IvlString& operator = (const IvlString&); IvlString& operator = (const char*); IvlString& operator = (const IvlShadowString&); IvlString& Assign (const char*, int); int Length () const; }; class IvlShadowString { private: const char* Str; public: inline IvlShadowString () { Str = 0; } IvlShadowString (const char*); IvlShadowString (const IvlString&); inline IvlShadowString& operator = (const IvlString& s) { Str = (const char*) s; return *this; } inline IvlShadowString& operator = (const char* s) { Str = s; return *this; } inline operator const char* () const { return Str; } int Length () const; }; #endif /* String_H_ */