⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 text_file_handler.h

📁 以wxWidget撰寫的簡繁體中文轉換程式 已在Linux上編譯過
💻 H
字号:
/*  * Copyright (C) 2006, Dung-Bang Tsai * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. * * ( If you wnat to use this library for commercial use,  *	  feel free to contact me, just cost some money, I could sell *		you the code without GPL license, so you could use this code *		for your product without public your source code.  				) * * Authors: *	Tsai, Dung-Bang <dbtsai@gmail.com> *			*			2006/03/10		at NCKU physics */#ifndef  _text_file_handler_H_#define  _text_file_handler_H_#include "wx/wx.h"#include "wx/ffile.h"#include "../engine/TDBConvertEngine.h"#include "../engine/TDBConvertEncode.h"class text_file_handler{	public:	text_file_handler():raw_n_bytes(0),raw_buffer_n_bytes(0) , code(0), raw_data(NULL) ,BOM(false){return;}	~text_file_handler()	{		if(raw_data != NULL) 		{			delete [] raw_data;		} 	}	//	Detect_code_page	void SetFileName(wxString filename_t){filename = filename_t;}	void SetString(TDBstring& string_t){string = &string_t;}	void SetCodePage(int code_t){code = code_t;}	void Read(size_t n_byte=0);	void Detect_code_page();	void ConvertFromSrcToString();	void GetInfo(wxString& NewLine,wxString &Code, wxString &bom)	{		if(newline == Unix)   NewLine =  (wxString)wxT("LF/0A (UNIX)");		else if(newline == Mac) NewLine =  (wxString)wxT("CR/0D (MAC)");		else if(newline == DOS) NewLine =  (wxString)wxT("CRLF/0D0A (DOS)");		else NewLine =  (wxString)wxT("Who know? You tell me.");					Code = CodePageName(code);		if(BOM==true)  bom = _T("有");		else bom = _T("沒有");					return;	}		private:		int code;  // See enum_code_page.h		char newline;    //Unix=1, Mac=2, DOS=3		bool BOM;		wxString filename;		TDBstring* string;		TDBdetect_code_page code_page;				unsigned char* raw_data;	    size_t raw_n_bytes;					// 實際檔案大小		size_t raw_buffer_n_bytes;  // 實際上處理沒全部讀進來, 只讀buffer_n_byte};#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -