www.pudn.com > MINSortDict.zip > MinidxGUICom.h


//************************************************************************* 
// You are free to use/modify this code but leave this header intact. 
// This class is public domain so you are free to use it any of 
// your applications (Freeware,Shareware,Commercial). All I ask is 
// that you let me know so that if you have a real winner I can 
// brag to my buddies that some of my code is in your app. I also 
// wouldn't mind if you sent me a copy of your application since I 
// like to play with new stuff. 
// Author	: DingZhiGang 
// Email	: minidxer@gmail.com 
// HomePage : http://minidx.com 
// Help     : http://minidx.com/forum/ 
//************************************************************************* 
 
#pragma once 
// 2007/03/29 
// このクラスは主にMinidx画面系の共通関数 
#include "stdafx.h" 
 
// data compression library 
//#define HAS_LZO_COMPRESS_DEFINED 1 
 
// data compression library 
//#ifdef HAS_LZO_COMPRESS_DEFINED 
//#include "minilzo.h" 
//#endif 
 
 
#ifdef HAS_LZO_COMPRESS_DEFINED 
/* Work-memory needed for compression. Allocate memory in units 
 * of `lzo_align_t' (instead of `char') to make sure it is properly aligned. 
 */ 
 
#define HEAP_ALLOC(var,size) \ 
    lzo_align_t __LZO_MMODEL var [ ((size) + (sizeof(lzo_align_t) - 1)) / sizeof(lzo_align_t) ] 
 
static HEAP_ALLOC(wrkmem,LZO1X_1_MEM_COMPRESS); 
 
#endif 
 
enum modes{ONLEFILE, ALLDIRFELE}; 
 
class CMinidxGUICom 
{ 
public: 
	CMinidxGUICom(void); 
	~CMinidxGUICom(void); 
public: 
	 
// 「'」→「''」に変換する 
	// 関数外開放しなければいけない 
	static char *st_replace(char *str); 
 
	// wchar_t → utf8 
	// 
	static size_t	wctoutf8(char * utf, const wchar_t wc); 
 
	// wchar_t → utf8 
	//  
	static size_t	wcstoutf8(char * utf,size_t ulen, const wchar_t * wcs, size_t wlen); 
 
	// utf8 → wchar_t 
	// 
	static size_t	utf8towc(wchar_t *wc, const char *utf, size_t ulen); 
 
	// utf8 → wchar_t 
	//  
	static size_t	utf8towcs(wchar_t * wcs,size_t wlen,const char * utf, size_t ulen); 
 
	// utf8 → wchar_t 
	// for tooltips 
	//  
	static size_t utf8towcs_tooltips(wchar_t * wcs,size_t wlen,const char * utf, size_t ulen, size_t ret_len); 
 
	// Integer長さを取得 
	// 
	static int get_int_length(int n); 
 
	// CString→TCHAR 変換 
	//  
	static TCHAR* CString2TCHAR(CString &str); 
 
	// delete dir and files 
	//  
	static bool removeDirFile(CString sPathfile, modes MD ); 
 
	//static bool DeleteDirectoryEx(const TCHAR *p); 
 
	// split CString 
	//  
	static void decodeCString(CString source, CStringArray& dest, char division); 
 
	// if file exist, TRUE 
	// if file not exist FALSE 
	//  
	static BOOL IsFileExist(CString strFileName); 
 
};