blob: 4aa83caf3d4accb321f7101dd935e90f17d6a037 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
|
/*
* CENA C++ Utilities
*
* by Stephane Chatty
*
* Copyright 1991, 1992
* Laboratoire de Recherche en Informatique (LRI)
* Centre d'Etudes de la Navigation Aerienne (CENA)
*
* CcuString 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 CcuShadowString;
class CcuString {
private:
char* Str;
public:
inline CcuString () { Str = 0; }
CcuString (const char*);
CcuString (int);
CcuString (const CcuString&);
CcuString (const CcuShadowString&);
~CcuString ();
CcuString& operator = (const CcuString&);
CcuString& operator = (const char*);
CcuString& operator = (const CcuShadowString&);
inline operator const char* () const { return Str; }
int Length () const;
};
class CcuShadowString {
private:
const char* Str;
public:
inline CcuShadowString () { Str = 0; }
CcuShadowString (const char*);
CcuShadowString (const CcuString&);
inline CcuShadowString& operator = (const CcuString& s) { Str = (const char*) s; return *this; }
inline CcuShadowString& operator = (const char* s) { Str = s; return *this; }
inline operator const char* () const { return Str; }
int Length () const;
};
#endif /* String_H_ */
|