Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

[bcbb26]: SecString.h Maximize Restore History

Download this file

SecString.h    84 lines (68 with data), 2.7 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
/*
* Copyright (c) 2003-2007 Rony Shapiro <ronys@users.sourceforge.net>.
* All rights reserved. Use of the code is allowed under the
* Artistic License terms, as specified in the LICENSE file
* distributed with this code, or available from
* http://www.opensource.org/licenses/artistic-license.php
*/
#pragma once
/// \file MyString.h
//-----------------------------------------------------------------------------
//-----------------------------------------------------------------------------
class SecString
: public string
{
public:
/// default constructor
SecString()
{}
/// copy constructor
SecString(const SecString& src)
: string(src)
{}
// I'll add others as needed...
/// destructor
~SecString();
TCHAR operator[](int nIndex) const;
void SetAt(int nIndex, TCHAR ch);
operator CString() const;
operator LPCTSTR() const;
BOOL IsEmpty() const;
BOOL LoadString(UINT nID);
const SecString& operator=(const SecString& stringSrc);
const SecString& operator=(TCHAR ch);
const SecString& operator=(LPCSTR lpsz);
const SecString& operator=(LPCWSTR lpsz);
const SecString& operator=(const unsigned char* psz);
const SecString& operator+=(const SecString& string);
const SecString& operator+=(TCHAR ch);
const SecString& operator+=(LPCTSTR lpsz);
// CMytring operator+(LPCTSTR lpsz);
friend SecString AFXAPI operator+(const SecString& string1,const SecString& string2);
friend SecString AFXAPI operator+(const SecString& string, TCHAR ch);
friend SecString AFXAPI operator+(TCHAR ch, const SecString& string);
friend SecString AFXAPI operator+(const SecString& string, LPCTSTR lpsz);
friend SecString AFXAPI operator+(LPCTSTR lpsz, const SecString& string);
SecString Mid(int nFirst, int nCount) const;
LPTSTR GetBuffer(int nMinBufLength);
void ReleaseBuffer(int nNewLength = -1);
int GetLength() const;
int Find( TCHAR ch ) const;
int Find( LPCTSTR lpszSub ) const;
CString Left( int nCount ) const;
CString Right( int nCount ) const;
CString m_mystring;
private:
void trashstring();
};
//-----------------------------------------------------------------------------
bool operator==(const SecString& s1, const SecString& s2);
bool operator==(const SecString& s1, LPCTSTR s2);
bool operator==(LPCTSTR s1, const SecString& s2);
bool operator!=(const SecString& s1, const SecString& s2);
bool operator!=(const SecString& s1, LPCTSTR s2);
bool operator!=(LPCTSTR s1, const SecString& s2);
//-----------------------------------------------------------------------------
// Local variables:
// mode: c++
// End: