-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCString.h
More file actions
46 lines (39 loc) · 1.78 KB
/
CString.h
File metadata and controls
46 lines (39 loc) · 1.78 KB
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
/*
* \file CString.h
* \brief simple string class
*
* \review
*/
#include <StdStream/StdStream.h>
#include <StdTest/StdTest.h>
#include <Stl.h>
//----------------------------------------------------------------------------------------------------------------------
class CString
{
public:
CString ();
/*explicit*/ CString (const char *str);
/*explicit*/ CString (const CString &str);
~CString ();
bool isEmpty () const;
const char * data () const;
void print () const;
operator char * ();
operator const char * ();
CString operator + (const CString &str) const;
CString & operator = (const CString &str);
bool operator == (const CString &str) const;
bool operator != (const CString &str) const;
bool operator == (const char *str) const;
bool operator != (const char *str) const;
void operator () () const;
const char & operator [] (std::size_t i) const;
char & operator [] (std::size_t i);
// don't forget comparison operators
friend std::istream & operator >> (std::istream &is, CString &obj);
friend std::ostream & operator << (std::ostream &os, const CString &obj);
private:
char * _m_pszData;
};
//--------------------------------------------------------------------------------------------------
#include "CString.inl"