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

📄 htm2txt.h

📁 pdf,html,ps等转txt的头文件和库。还包括ictclas中科院计算所的中文分词工具有.h和.lib和.d
💻 H
字号:
/////////////////////////////////////////////////////////////////////////////
// Copyright(c) 2005 Digitized Technology Laboratory, ICT
// All rights reserved.
// 
// Filename:	htm2txt.h
// Description: declare class which extracts html content to text.	
//		
// Author:	Luo Weihua
// Email:	luoweihua@ict.ac.cn
// Version:	0.1
// Creation Date: 2005-12-14
// Log:		1. Created by Luo Weihua in 2005-12-14
/////////////////////////////////////////////////////////////////////////////
//使用方法:
//pTxt是需转换的html数据,转换之后的结果也存在这里,转换所得标题存入pTitle,如果pTitle=NULL,则不提取标题
//
//	CHtm2Txt h2t; 
//	char pTitle[BUFFER_LEN];
//	h2t.fn_bConvert(pTxt,pTitle);		
//

#ifndef _HTM2TXT_H_
#define _HTM2TXT_H_

#pragma warning(disable:4786 4305 4309)

#include <string.h>
#include <stdio.h>
#include <stdlib.h>
#include <malloc.h>
#include <io.h>

#define BUFFER_LEN   4096 // buffer lenght
#define CV_EXITPARA     1 // parameter error
#define CV_EXITOPEN     2 // open error
#define CV_EXITEXIST    3 // file exist

class _declspec(dllexport) CHtm2Txt
{
public:
	CHtm2Txt();
	~CHtm2Txt();
	
	bool fn_bConvert(char* pTxt, char* pTitle);
	bool fn_bConvert(const char* pFileIn, const char* pFileOut, char* pTitle);
	
	char* m_pTitle;

private:
	void dfPrintLogo(void);      // logo
	void dfPrintInfo(void);      // parameter info
	void dfPrintOpenError( const char * InFile ); // open error
	void dfPrintExist( const char * OutFile );    // file Exist
	void dfConvert( char * Buffer);  // convert string
	int dfCheckChar( int iLen,
					 char *Buffer,
					 int iPointer,
					 char *Check,
					 int iCheckLen );
	bool dfGetTitle(char* pTxt, char* pTitle);
	
};

#endif//_HTM2TXT_H_

⌨️ 快捷键说明

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