Debian Codegraph @

src/ITGSend/newran/simpstr.h

raw symbols SCIP
1 /// \ingroup newran
2 ///@{
3
4 /// \file simpstr.h
5 /// A very simple string class - headers.
6 /// Use where I don't want to include my full string class or
7 /// the standard string class
8
9 #ifndef SIMPLE_STRING_LIB
10 #define SIMPLE_STRING_LIB
11
12 #ifdef use_namespace
13 namespace RBD_COMMON {
14 #endif
15
16
17 /// A very simple string class.
18 class SimpleString
19 {
20 char* S; ///< pointer to the character string
21 unsigned int n; ///< length of string excluding terminal 0
22 public:
23 SimpleString();
24 ~SimpleString() { delete [] S; }
25 SimpleString(const SimpleString& s);
26 SimpleString(const char* c);
27 SimpleString(unsigned int i, char c);
28 void operator=(const SimpleString& s);
29 void operator=(const char*);
30 void operator=(char);
31 void operator+=(const SimpleString& s);
32 void operator+=(const char*);
33 void operator+=(char);
34 friend SimpleString operator+(const SimpleString& s1, const SimpleString& s2);
35 friend SimpleString operator+(const char* c1, const SimpleString& s2);
36 friend SimpleString operator+(const SimpleString& s1, const char* c2);
37 friend SimpleString operator+(char c1, const SimpleString& s2);
38 friend SimpleString operator+(const SimpleString& s1, char c2);
39 unsigned int length() const { return n; }
40 unsigned int size() const { return n; }
41 const char* c_str() const { return S; }
42 const char* data() const { return S; }
43 };
44
45 #ifdef use_namespace
46 }
47 #endif
48
49
50 #endif // SIMPLE_STRING_LIB
51
52
53 // body file: simpstr.cpp
54
55
56 ///@}
57