source: trunk/src/ole32/oString.h

Last change on this file was 872, checked in by davidr, 26 years ago

Added CVS ID lines to all source files

File size: 2.5 KB
RevLine 
[872]1/* $Id: oString.h,v 1.4 1999-09-08 11:29:28 davidr Exp $ */
[198]2
3#if !defined(OSTRING_INCLUDED)
4#define OSTRING_INCLUDED
5
[290]6class oStringBase
[198]7{
[290]8protected:
9 char * m_strBuf; // Buffer.
10
[198]11 long m_bufLen; // Current allocated length
[290]12 // of buffer (bytes)
[198]13
[290]14 long m_bytePerChar; // Number of bytes per character.
[198]15 long m_strLen; // Length of string
16 // incl. zero terminator
17
18 HANDLE m_Heap; // heap handle.
19
20 static long blockSize;
21
[290]22 oStringBase(long bytePerChar);
23 virtual ~oStringBase();
24
[198]25 void freeBuf();
26 void getBuf(long newLen);
27 void adjBuf(long newLen);
28 long calcBufLen(long newLen);
[290]29};
[198]30
[290]31class oStringA : public oStringBase
32{
[198]33public:
34 oStringA(void);
[851]35 oStringA(int defLen, int fill);
[198]36 oStringA(LPCWSTR pUnicode);
37 oStringA(LPCSTR pAscii);
[290]38 oStringA(REFCLSID pclsId);
[198]39 oStringA(const oStringA &ref);
[851]40 oStringA(const ULONG val);
41 oStringA(const LONG val);
42 oStringA(const USHORT val);
43 oStringA(const SHORT val);
[198]44
45 operator LPSTR();
46
[290]47 // Assignment
[198]48 oStringA operator = (const oStringA & string);
49 oStringA operator = (LPCSTR pAscii);
50 oStringA operator = (LPCWSTR pUnicode);
[290]51 oStringA operator = (REFCLSID pClsId);
[198]52
53 // Concatenation
54 oStringA operator + (const oStringA & string);
55 oStringA operator + (LPCSTR pAscii);
56 oStringA operator + (LPCWSTR pUnicode);
57
[290]58 // Concatenation & Assignment.
[198]59 oStringA operator += (const oStringA & string);
60 oStringA operator += (LPCSTR pAscii);
61 oStringA operator += (LPCWSTR pUnicode);
62
63};
64
[290]65class oStringW : public oStringBase
66{
67public:
68 oStringW(void);
[851]69 oStringW(int defLen, int fill);
[290]70 oStringW(LPCWSTR pUnicode);
71 oStringW(const wchar_t * pUnicode);
72 oStringW(LPCSTR pAscii);
73 oStringW(REFCLSID pclsId);
74 oStringW(const oStringW &ref);
75
76 operator LPWSTR();
77
78 // Assignment
79 oStringW operator = (const oStringW & string);
80 oStringW operator = (LPCSTR pAscii);
81 oStringW operator = (LPCWSTR pUnicode);
82 oStringW operator = (const wchar_t * pUnicode);
83 oStringW operator = (REFCLSID pClsId);
84
85 // Concatenation
86 oStringW operator + (const oStringW & string);
87 oStringW operator + (LPCSTR pAscii);
88 oStringW operator + (LPCWSTR pUnicode);
89 oStringW operator + (const wchar_t * pUnicode);
90
91 // Concatenation & Assignment.
92 oStringW operator += (const oStringW & string);
93 oStringW operator += (LPCSTR pAscii);
94 oStringW operator += (LPCWSTR pUnicode);
95 oStringW operator += (const wchar_t * pUnicode);
96
97};
98
[198]99#endif // OSTRING_INCLUDED
Note: See TracBrowser for help on using the repository browser.