Jungo WinDriver  
Official Documentation
cstring.h
Go to the documentation of this file.
1/* @JUNGO_COPYRIGHT@ */
2
3#ifndef _CSTRING_H_
4#define _CSTRING_H_
5
6#include <stdarg.h>
7
8typedef const char* PCSTR;
10{
11public:
12 // Constructors
14 CCString(const CCString& stringSrc);
15 CCString(PCSTR pcwStr);
16
17 virtual ~CCString();
18
19 operator PCSTR() const;
20 operator char *() const;
21
22 // MFC compatibility functions
23 // overloaded assignment
24 const int operator==(const CCString& s);
25 const int operator==(const char *s);
26 const int operator!=(const CCString& s);
27 const int operator!=(const char *s);
28 const CCString& operator=(const CCString& s);
30 const CCString& operator+=(const PCSTR s);
31 const CCString& cat_printf(const PCSTR format, ...);
32 char& operator[](int i);
33 int Compare(PCSTR s);
35 const int operator!=(char *s);
36 void MakeUpper();
37 void MakeLower();
38
39 // sub-string extraction
40 CCString Mid(int nFirst, int nCount);
41 CCString Mid(int nFirst);
42
45
46 int Length() const;
48 bool is_empty();
49 char *m_str; // The String itself
50
51 void Format(const PCSTR format, ...);
52 int IsAllocOK();
53 int GetBuffer(unsigned long size);
54
55 // ANSI C compatibility functions
56 int strcmp(const PCSTR s);
57 int stricmp(const PCSTR s);
58 void sprintf(const PCSTR format, ...);
59 void toupper();
60 void tolower();
63 int find_first(char c) const;
64 int find_last(char c) const;
65 CCString substr(int start, int end) const;
66 CCString trim(int index) const;
67
68protected:
69 void Init();
70 void vsprintf(const PCSTR format, va_list ap);
72};
73
74const CCString operator+(const CCString &str1, const CCString &str2);
75
76#if !defined(WIN32)
77 int stricmp(PCSTR str1, PCSTR str2);
78#endif
79
80#endif /* _CSTRING_H_ */
81
const CCString & cat_printf(const PCSTR format,...)
int Compare(PCSTR s)
char * m_str
Definition: cstring.h:49
CCString substr(int start, int end) const
void sprintf(const PCSTR format,...)
void Init()
CCString Mid(int nFirst)
char & operator[](int i)
CCString StrReplace(PCSTR str, PCSTR new_str)
const CCString & operator+=(const PCSTR s)
void toupper()
const CCString & operator=(PCSTR s)
int find_last(char c) const
void Format(const PCSTR format,...)
void MakeLower()
int strcmp(const PCSTR s)
void MakeUpper()
int CompareNoCase(PCSTR s)
CCString(PCSTR pcwStr)
CCString(const CCString &stringSrc)
const int operator!=(const char *s)
int stricmp(const PCSTR s)
virtual ~CCString()
bool contains(PCSTR substr)
int find_first(char c) const
const int operator==(const char *s)
CCString trim(int index) const
const int operator!=(const CCString &s)
int GetBuffer(unsigned long size)
bool is_empty()
void vsprintf(const PCSTR format, va_list ap)
CCString StrRemove(PCSTR str)
const CCString & operator=(const CCString &s)
int IsAllocOK()
void tolower()
int Length() const
CCString Mid(int nFirst, int nCount)
CCString tolower_copy(void) const
const int operator!=(char *s)
const int operator==(const CCString &s)
int m_buf_size
Definition: cstring.h:71
CCString toupper_copy(void) const
const char * PCSTR
Definition: cstring.h:8
const CCString operator+(const CCString &str1, const CCString &str2)
#define stricmp
Definition: windrvr.h:313