Fix typo in changelog
[TortoiseGit.git] / src / Utils / SpeedPostEmail.h
blobbcabcb82334ab97a317e24b2eaac9267a4a9fdec
1 #pragma once
3 #ifndef GET_SAFE_STRING
4 #define GET_SAFE_STRING(str) ( (str)?(str):_T("") )
5 #endif
6 // _vsnprintf º¯Êý
7 #ifndef _vsnprintf_hw
8 #ifdef UNICODE
9 #define _vsnprintf_hw _vsnwprintf_s
10 #else
11 #define _vsnprintf_hw _vsnprintf_s
12 #endif
13 #endif
14 #define HANDLE_IS_VALID(h) ( (HANDLE)(h)!=NULL && (HANDLE)(h)!=INVALID_HANDLE_VALUE )
16 enum
18 STRING_IS_MULTICHARS = 0, // ÊǶà×Ö½Ú×Ö·û´®
19 STRING_IS_UNICODE, // ÊÇUNICODE×Ö·û´®
20 STRING_IS_SOFTCODE, // ÊǺͳÌÐòÒ»ÑùµÄ×Ö·û´®±àÂë
23 class CMultiByteString
25 public:
26 CMultiByteString ( LPCTSTR lpszOrg, int nOrgStringEncodeType=STRING_IS_SOFTCODE, OUT char *pOutBuf=NULL, int nOutBufSize=0 );
27 ~CMultiByteString ();
28 char *GetBuffer()
30 if ( m_pszData ) return m_pszData;
31 return "";
33 // »ñÈ¡×Ö·û´®¸öÊý
34 int GetLength()
36 return m_nCharactersNumber;
38 // »ñÈ¡×Ö·û´®Õ¼ÓÃÄÚ´æ´óС£¨×Ö½ÚÊý£¬°üÀ¨×Ö·û´®½áÊøµÄ'\0'ËùÕ¼µÄλÖã©
39 int GetSize()
41 return m_nDataSize;
43 private:
44 char *m_pszData; // ±£´æÄ¿±ê×Ö·û´®µÄ»º³å
45 int m_nDataSize; // Ä¿±ê×Ö·û´®Õ¼ÓõÄÄÚ´æ´óС£¨×Ö½ÚÊý£¬°üÀ¨×Ö·û´®½áÊøµÄ'\0'£©
46 int m_nCharactersNumber; // Ä¿±ê×Ö·û´®µÄ¸öÊý
47 BOOL m_bNewBuffer; // ÊÇ·ñÔÚÕâ¸öÀàÖÐÉêÇëÁËÄÚ´æ
50 CString GetCompatibleString ( LPVOID lpszOrg, BOOL bOrgIsUnicode, int nOrgLength=-1 );
51 CString FormatDateTime ( COleDateTime &DateTime, LPCTSTR pFormat );
52 CString FormatString ( LPCTSTR lpszStr, ... );
53 int hwGetFileAttr ( LPCTSTR lpFileName, OUT CFileStatus *pFileStatus=NULL );
54 CString FormatBytes ( double fBytesNum, BOOL bShowUnit=TRUE, int nFlag=0 );
55 BOOL WaitForThreadEnd ( HANDLE *phThread, DWORD dwWaitTime=10*1000 );
57 //{{AFX_INSERT_LOCATION}}
58 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.