summaryrefslogtreecommitdiff
path: root/utils/String.h
blob: 7fa332969cf82212f42e27c46aa9943d48579346 (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
62
63
64
65
66
67
/*
 *	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_

#ifdef __GNUG__
#pragma interface
#endif

#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 (const char*, int);
		CcuString (int);
		CcuString (const CcuString&);
		CcuString (const CcuShadowString&);
		~CcuString ();
inline	operator	const char* () const		{ return Str; }
	CcuString&	operator = (const CcuString&);
	CcuString&	operator = (const char*);
	CcuString&	operator = (const CcuShadowString&);
	CcuString&	Assign (const char*, int);
	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_ */