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

📄 cmpmngr.h

📁 A File Comparer with visual output
💻 H
字号:
// CmpMngr.h: interface for the CCmpMngr class.
//
//////////////////////////////////////////////////////////////////////

#include "BitMatrix.h"
#include "Diff.h"


typedef std::pair<int,std::string> line;
typedef std::vector< line > filemap;
typedef std::vector< line >::iterator filemapIt;

typedef std::pair<int,int> hashed_line;
typedef std::vector< hashed_line > hashed_filemap;
typedef std::vector< hashed_line >::iterator hashed_filemapIt;

typedef std::pair<int,int> match_pair;
typedef std::vector< match_pair > match;


class CCmpMngr  
{
public:
	bool HTML_template(std::string command, ofstream& ofsL, ofstream& ofsR);
	bool HTML_mainFrame(ofstream& ofs);
	bool print_diff_in_HTML(std::string outDir);
	bool compare();
	
	std::string compFile;
	std::string baseFile;
	long nProgress;
	long nRange;

	int nAddedLines;
	int nDeletedLines;
	int nChangedLines;
			
	CDiff theDiffFile;
	CBitMatrix LCSBitMatrix;


	CCmpMngr();
	virtual ~CCmpMngr();

private:
	filemap compFileMap;
	filemap baseFileMap;
	hashed_filemap baseHmap,compHmap;
	match match_pairs;
	bool readInto(ifstream &file,filemap &f);
	bool compare_hashed_files(hashed_filemap& bHm,hashed_filemap& cHm,match& dHm,std::string algorithm = "default");
	bool compare_hashed_files_default(hashed_filemap& bHm,hashed_filemap& cHm,match& dHm);
    bool compare_hashed_files_LCS(hashed_filemap& bHm,hashed_filemap& cHm,match& dHm);
	int hash_string(std::string& s);
	bool hash(filemap& f, hashed_filemap& hf);
	bool sort(filemap& fm);
};

⌨️ 快捷键说明

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