亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? basicexcel.hpp

?? 對(duì)EXCEL的操作
?? HPP
?? 第 1 頁(yè) / 共 3 頁(yè)
字號(hào):
// Created by Yap Chun Wei
// Version 1.0 (20 April 2006)
// Version 1.1 (22 April 2006)
	// - Fixed bugs with compound files not being able to write files more than 65535 bytes.
	// - Fixed bugs with reading and writing to Excel files containing many strings.
// Version 1.2 (30 April 2006)
	// - Added operator<< to pass BasicExcelCell to an output stream.
	// - Added Print() to BasicExcelWorksheet to print the worksheet to an output stream.
	// - Change BasicExcelCell Get functions to const functions.
	// - Rename BasicExcelWorksheet functions RenameWorkSheet() to Rename().
// Version 1.3 (10 May 2006)
	// - Fixed bugs with reading from Excel files containing Asian characters.
// Version 1.4 (13 May 2006)
	// - Fixed bugs with reading and writing to Excel files containing many strings.
// Version 1.5 (15 May 2006)
	// - Remove code for ExtSST because it was causing problems with reading and writing to Excel files containing many strings.
// Version 1.6 (16 May 2006)
	// - Optimized code for reading and writing.
// Version 1.7 (22 May 2006)
	// - Fixed code to remove some warnings.
	// - Fixed bug with BasicExcelWorksheet::Cell.
	// - Fixed bug with BasicExcel::UpdateWorksheets().
// Version 1.8 (23 May 2006)
	// - Fixed bug with reading Excel files containing many unicode strings.
	// - Fixed code to remove some warnings.
	// - Fixed variable code_ duplication in BoolErr.
	// - Minor changes to BasicExcelCell:Set functions.
// Version 1.9 (24 May 2006)
	// - Changed name_ in Style from SmallString to LargeString.
	// - Fixed bug in BasicExcelCell::GetString and BasicExcelCell::GetWString.
	// - Minor changes to functions in BasicExcel and BasicExcelWorksheet which checks for unicode.
	// - Minor change to SmallString::Read.
// Version 1.10 (30 May 2006)
	// - Fixed bug with reading Excel files containing many strings.
	// - Remove memory leaks.
// Version 1.11 (2 June 2006)
	// - Fixed bug with reading and writing Excel files containing many unicode and ANSI strings.
// Version 1.12 (6 June 2006)
	// - Fixed bug with reading and writing Excel files containing many unicode and ANSI strings.

#ifndef BASICEXCEL_HPP
#define BASICEXCEL_HPP

#include <algorithm>
#include <cmath>
#include <functional>
#include <iostream>
#include <iomanip>
#include <fstream>
#include <map>
#include <vector>
using namespace std;

#define UTF16
#ifdef UTF16
	#define SIZEOFWCHAR_T 2
#else
	#define SIZEOFWCHAR_T sizeof(wchar_t)
#endif

namespace YCompoundFiles
{
class Block
// PURPOSE: In charge of handling blocks of data from a file
{
public:
	Block();

// File handling functions
	bool Create(const wchar_t* filename);
	bool Open(const wchar_t* filename, ios_base::openmode mode=ios_base::in | ios_base::out);
	bool Close();
	bool IsOpen();

// Block handling functions
	bool Read(size_t index, char* block);
	bool Write(size_t index, const char* block);
	bool Swap(size_t index1, size_t index2);
	bool Move(size_t from, size_t to);
	bool Insert(size_t index, const char* block);
	bool Erase(size_t index);
	bool Erase(vector<size_t>& indices);

// Misc functions
	size_t GetBlockSize() const {return blockSize_;}
	void SetBlockSize(size_t size) 
	{
		blockSize_ = size;
		indexEnd_ = fileSize_/blockSize_ + (fileSize_ % blockSize_ ? 1 : 0);
	}
	
protected:
	vector<char> filename_;
	ios_base::openmode mode_;
	fstream file_;
	size_t blockSize_;
	size_t indexEnd_;
	size_t fileSize_;
};

struct LittleEndian
{
	template<typename Type>
	static void Read(const char* buffer, Type& retVal, int pos=0, int bytes=0)
	{
		retVal = Type(0);
		if (bytes == 0) bytes = sizeof(Type);
		for (size_t i=0; i<bytes; ++i)
		{
			retVal |= ((Type)((unsigned char)buffer[pos+i])) << 8*i;
		}
	}

	template<typename Type>
	static void ReadString(const char* buffer, Type* str, int pos=0, int bytes=0)
	{
		for (size_t i=0; i<bytes; ++i) Read(buffer, str[i], pos+i*sizeof(Type));
	}

	template<typename Type>
	static void Write(char* buffer, Type val, int pos=0, int bytes=0)
	{
		if (bytes == 0) bytes = sizeof(Type);
		for (size_t i=0; i<bytes; ++i)
		{
			buffer[pos+i] = (unsigned char)val;
			val >>= 8;
		}
	}

	template<typename Type>
	static void WriteString(char* buffer, Type* str, int pos=0, int bytes=0)
	{
		for (size_t i=0; i<bytes; ++i) Write(buffer, str[i], pos+i*sizeof(Type));
	}

	template<typename Type>
	static void Read(const vector<char>& buffer, Type& retVal, int pos=0, int bytes=0)
	{
		retVal = Type(0);
		if (bytes == 0) bytes = sizeof(Type);
		for (size_t i=0; i<bytes; ++i)
		{
			retVal |= ((Type)((unsigned char)buffer[pos+i])) << 8*i;
		}
	}

	template<typename Type>
	static void ReadString(const vector<char>& buffer, Type* str, int pos=0, int bytes=0)
	{
		for (size_t i=0; i<bytes; ++i) Read(buffer, str[i], pos+i*sizeof(Type));
	}

	template<typename Type>
	static void Write(vector<char>& buffer, Type val, int pos=0, int bytes=0)
	{
		if (bytes == 0) bytes = sizeof(Type);
		for (size_t i=0; i<bytes; ++i)
		{
			buffer[pos+i] = (unsigned char)val;
			val >>= 8;
		}
	}

	template<typename Type>
	static void WriteString(vector<char>& buffer, Type* str, int pos=0, int bytes=0)
	{
		for (size_t i=0; i<bytes; ++i) Write(buffer, str[i], pos+i*sizeof(Type));
	}


	static void Read(const char* buffer, wchar_t& retVal, int pos=0, int bytes=0)
	{
		retVal = wchar_t(0);
		if (bytes == 0) bytes = SIZEOFWCHAR_T;
		for (int i=0; i<bytes; ++i)
		{
			retVal |= ((wchar_t)((unsigned char)buffer[pos+i])) << 8*i;
		}
	}

	static void ReadString(const char* buffer, wchar_t* str, int pos=0, int bytes=0)
	{
		for (int i=0; i<bytes; ++i) Read(buffer, str[i], pos+i*SIZEOFWCHAR_T);
	}

	static void Write(char* buffer, wchar_t val, int pos=0, int bytes=0)
	{
		if (bytes == 0) bytes = SIZEOFWCHAR_T;
		for (int i=0; i<bytes; ++i)
		{
			buffer[pos+i] = (unsigned char)val;
			val >>= 8;
		}
	}

	static void WriteString(char* buffer, wchar_t* str, int pos=0, int bytes=0)
	{
		for (int i=0; i<bytes; ++i) Write(buffer, str[i], pos+i*SIZEOFWCHAR_T);
	}

	static void Read(const vector<char>& buffer, wchar_t& retVal, int pos=0, int bytes=0)
	{
		retVal = wchar_t(0);
		if (bytes == 0) bytes = SIZEOFWCHAR_T;
		for (int i=0; i<bytes; ++i)
		{
			retVal |= ((wchar_t)((unsigned char)buffer[pos+i])) << 8*i;
		}
	}

	static void ReadString(const vector<char>& buffer, wchar_t* str, int pos=0, int bytes=0)
	{
		for (int i=0; i<bytes; ++i) Read(buffer, str[i], pos+i*SIZEOFWCHAR_T);
	}

	static void Write(vector<char>& buffer, wchar_t val, int pos=0, int bytes=0)
	{
		if (bytes == 0) bytes = SIZEOFWCHAR_T;
		for (int i=0; i<bytes; ++i)
		{
			buffer[pos+i] = (unsigned char)val;
			val >>= 8;
		}
	}

	static void WriteString(vector<char>& buffer, wchar_t* str, int pos=0, int bytes=0)
	{
		for (int i=0; i<bytes; ++i) Write(buffer, str[i], pos+i*SIZEOFWCHAR_T);
	}
};

class CompoundFile
{
public:
	enum {DUPLICATE_PROPERTY=-6,
		  NAME_TOO_LONG=-5, FILE_NOT_FOUND=-4, 
		  DIRECTORY_NOT_EMPTY=-3, DIRECTORY_NOT_FOUND=-2, 
		  INVALID_PATH=-1, 
		  SUCCESS=1};

	CompoundFile();
	~CompoundFile();

// User accessible functions
public:
	// Compound File functions
	bool Create(const wchar_t* filename);
	bool Open(const wchar_t* filename, ios_base::openmode mode=ios_base::in | ios_base::out);
	bool Close();
	bool IsOpen();

	// Directory functions
	int ChangeDirectory(const wchar_t* path);
	int MakeDirectory(const wchar_t* path);
	int PresentWorkingDirectory(wchar_t* path);
	int PresentWorkingDirectory(vector<wchar_t>& path);
	int RemoveDirectory(const wchar_t* path);
	int DelTree(const wchar_t* path);
	int DirectoryList(vector<vector<wchar_t> >& list, const wchar_t* path=0);

	// File functions
	int MakeFile(const wchar_t* path);
	int RemoveFile(const wchar_t* path);
	int FileSize(const wchar_t* path, size_t& size);
	int ReadFile(const wchar_t* path, char* data);
	int ReadFile(const wchar_t* path, vector<char>&data);
	int WriteFile(const wchar_t* path, const char* data, size_t size);
	int WriteFile(const wchar_t* path, const vector<char>&data, size_t size);


	// ANSI char functions
	bool Create(const char* filename);
	bool Open(const char* filename, ios_base::openmode mode=ios_base::in | ios_base::out);
	int ChangeDirectory(const char* path);
	int MakeDirectory(const char* path);
	int PresentWorkingDirectory(char* path);
	int PresentWorkingDirectory(vector<char>& path);
	int RemoveDirectory(const char* path);
	int DelTree(const char* path);
	int MakeFile(const char* path);
	int RemoveFile(const char* path);
	int FileSize(const char* path, size_t& size);
	int ReadFile(const char* path, char* data);
	int ReadFile(const char* path, vector<char>& data);
	int WriteFile(const char* path, char* data, size_t size);
	int WriteFile(const char* path, vector<char>& data, size_t size);

// Protected functions and data members
protected:
	// General functions and data members
	void IncreaseLocationReferences(vector<size_t> indices);
	void DecreaseLocationReferences(vector<size_t> indices);
	void SplitPath(const wchar_t* path, wchar_t*& parentpath, wchar_t*& propertyname);
	vector<char> block_;
	Block file_;

	// Header related functions and data members
	bool LoadHeader();
	void SaveHeader();
	class Header
	{
	public:
		Header();
		void Write(char* block);
		void Read(char* block);

		long long fileType_;		// Magic number identifying this as a compound file system (0x0000)
		int uk1_;					// Unknown constant (0x0008)
		int uk2_;					// Unknown constant (0x000C)
		int uk3_;					// Unknown constant (0x0010)
		int uk4_;					// Unknown constant (0x0014)
		short uk5_;					// Unknown constant (revision?) (0x0018)
		short uk6_;					// Unknown constant	(version?) (0x001A)
		short uk7_;					// Unknown constant (0x001C)
		short log2BigBlockSize_;	// Log, base 2, of the big block size (0x001E)
		int log2SmallBlockSize_;	// Log, base 2, of the small block size (0x0020)
		int uk8_;					// Unknown constant (0x0024)
		int uk9_;					// Unknown constant (0x0028)
		int BATCount_;				// Number of elements in the BAT array (0x002C)
		int propertiesStart_;		// Block index of the first block of the property table (0x0030)
		int uk10_;					// Unknown constant (0x0034)
		int uk11_;					// Unknown constant (0x0038)
		int SBATStart_;				// Block index of first big block containing the small block allocation table (SBAT) (0x003C)
		int SBATCount_;				// Number of big blocks holding the SBAT (0x0040)
		int XBATStart_;				// Block index of the first block in the Extended Block Allocation Table (XBAT) (0x0044)
		int XBATCount_;				// Number of elements in the Extended Block Allocation Table (to be added to the BAT) (0x0048)
		int BATArray_[109];			// Array of block indices constituting the Block Allocation Table (BAT) (0x004C, 0x0050, 0x0054 ... 0x01FC)

		size_t bigBlockSize_;
		size_t smallBlockSize_;

	private:
		void Initialize();
	};	
	Header header_;

	// BAT related functions and data members
	void LoadBAT();
	void SaveBAT();
	size_t DataSize(size_t startIndex, bool isBig);
	size_t ReadData(size_t startIndex, char* data, bool isBig);
	size_t WriteData(const char* data, size_t size, int startIndex, bool isBig);
	void GetBlockIndices(size_t startIndex, vector<size_t>& indices, bool isBig);
	size_t GetFreeBlockIndex(bool isBig);
	void ExpandBATArray(bool isBig);
	void LinkBlocks(size_t from, size_t to, bool isBig);
	void FreeBlocks(vector<size_t>& indices, bool isBig);
	vector<int> blocksIndices_;
	vector<int> sblocksIndices_;	

	// Properties related functions and data members
	class Property
	{
	public:
		Property();		
		void Write(char* block);
		void Read(char* block);
		friend bool operator==(const CompoundFile::Property& lhs, const CompoundFile::Property& rhs) 
		{
			return (!wcscmp(lhs.name_, rhs.name_));
		}
		friend bool operator< (const CompoundFile::Property& lhs, const CompoundFile::Property& rhs)
		{
			size_t maxLen1 = wcslen(lhs.name_);
			size_t maxLen2 = wcslen(rhs.name_);
			if (maxLen1 < maxLen2) return true;
			else if (maxLen1 > maxLen2) return false;
			else
			{
				int result = wcscmp(lhs.name_, rhs.name_);
				if (result <= 0) return true;
				else return false;
			}
		}
		friend bool operator!=(const CompoundFile::Property& lhs, const CompoundFile::Property& rhs) {return !(lhs == rhs);}
		friend bool operator> (const CompoundFile::Property& lhs, const CompoundFile::Property& rhs) {return (rhs < lhs);}
		friend bool operator<=(const CompoundFile::Property& lhs, const CompoundFile::Property& rhs) {return !(rhs < lhs);}
		friend bool operator>=(const CompoundFile::Property& lhs, const CompoundFile::Property& rhs) {return !(lhs < rhs);}

		wchar_t name_[32];				// A unicode null-terminated uncompressed 16bit string (lblocke the high bytes) containing the name of the property. (0x00, 0x02, 0x04, ... 0x3E)
		short nameSize_;				// Number of characters in the NAME field (0x40)
		unsigned char propertyType_;	// Property type (directory, file, or root) Byte 1 (directory), 2 (file), or 5 (root entry) (0x42)
		unsigned char nodeColor_;		// Node color (0x43)
		int previousProp_;				// Previous property index (0x44)
		int nextProp_;					// Next property index (0x48)
		int childProp_;					// First child property index (0x4c)
		int uk1_;
		int uk2_;
		int uk3_;
		int uk4_;
		int uk5_;
		int seconds1_;					// Seconds component of the created timestamp? (0x64)
		int days1_;						// Days component of the created timestamp? (0x68)
		int seconds2_;					// Seconds component of the modified timestamp? (0x6C)
		int days2_;						// Days component of the modified timestamp? (0x70)
		int startBlock_;				// Starting block of the file, used as the first block in the file and the pointer to the next block from the BAT (0x74)
		int size_;						// Actual size of the file this property points to. (used to truncate the blocks to the real size). (0x78)
	};
	class PropertyTree
	{
	public:
		PropertyTree();
		~PropertyTree();
		PropertyTree* parent_;
		Property* self_;
		size_t index_;
		vector<PropertyTree*> children_;
	};
	void LoadProperties();
	void SaveProperties();
	int MakeProperty(const wchar_t* path, Property* property);
	PropertyTree* FindProperty(size_t index);
	PropertyTree* FindProperty(const wchar_t* path);
	PropertyTree* FindProperty(PropertyTree* parentTree, wchar_t* name);

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产三区在线成人av| 欧美一级片免费看| 国产福利一区二区三区视频| 捆绑调教一区二区三区| 日韩中文字幕麻豆| 日韩va欧美va亚洲va久久| 夜夜夜精品看看| 亚洲一线二线三线视频| 亚洲成在人线在线播放| 亚洲在线一区二区三区| 午夜视频一区二区| 日本 国产 欧美色综合| 激情av综合网| 国产91精品露脸国语对白| 大白屁股一区二区视频| 成人的网站免费观看| 91极品视觉盛宴| 欧美挠脚心视频网站| 欧美一区二区三区在线观看视频| 日韩你懂的在线播放| 久久久亚洲精品一区二区三区| 国产欧美日韩综合精品一区二区| 国产精品久久久久久久久图文区| 亚洲欧美色一区| 日本在线不卡视频一二三区| 国产一区在线观看视频| 成人激情校园春色| 在线精品亚洲一区二区不卡| 日韩欧美中文字幕公布| 国产亚洲女人久久久久毛片| 亚洲丝袜制服诱惑| 五月天亚洲精品| 国产乱人伦偷精品视频不卡| 色偷偷88欧美精品久久久| 欧美精品 日韩| 国产日韩av一区| 亚洲永久精品国产| 久久69国产一区二区蜜臀| av一区二区三区黑人| 欧美久久久一区| 国产欧美日韩精品在线| 亚洲香蕉伊在人在线观| 国产精品亚洲专一区二区三区 | 北条麻妃一区二区三区| 欧美影视一区在线| 久久亚洲二区三区| 一区二区三国产精华液| 紧缚奴在线一区二区三区| 91在线观看污| 欧美岛国在线观看| 夜夜精品视频一区二区| 狠狠色狠狠色合久久伊人| 日本久久电影网| 久久久久久久久一| 日韩中文字幕麻豆| 一本一道久久a久久精品综合蜜臀| 91精品综合久久久久久| 成人免费一区二区三区在线观看| 日韩福利电影在线观看| 波多野结衣中文一区| 欧美一区二区三区视频免费| 亚洲欧洲另类国产综合| 韩国精品主播一区二区在线观看 | 亚洲日本护士毛茸茸| 激情伊人五月天久久综合| 精品视频1区2区3区| 国产精品久线在线观看| 久久aⅴ国产欧美74aaa| 精品视频在线视频| 亚洲免费在线电影| 丰满少妇在线播放bd日韩电影| 欧美久久一区二区| 亚洲一区二区在线视频| 成人动漫av在线| 久久影院午夜论| 99久久99久久精品免费看蜜桃| 日韩一区二区三| 亚洲午夜羞羞片| 91丝袜美女网| 国产精品无码永久免费888| 美女免费视频一区二区| 欧美日韩亚洲另类| 一区二区日韩av| 色www精品视频在线观看| 中文字幕乱码日本亚洲一区二区 | 日本精品视频一区二区| 国产精品伦理一区二区| 国产福利一区在线| 久久久不卡网国产精品二区| 国内不卡的二区三区中文字幕| 日韩欧美精品三级| 日韩av成人高清| 91精品中文字幕一区二区三区| 亚洲成人777| 91超碰这里只有精品国产| 亚洲成av人综合在线观看| 欧美三级电影在线看| 亚洲444eee在线观看| 欧美三级韩国三级日本一级| 亚洲国产精品一区二区久久| 精品视频1区2区| 三级不卡在线观看| 91精品综合久久久久久| 另类小说欧美激情| 精品国产污污免费网站入口| 激情五月激情综合网| 久久久亚洲精品一区二区三区| 国产精品一二三四五| 国产精品护士白丝一区av| av一本久道久久综合久久鬼色| 自拍偷拍欧美精品| 色国产精品一区在线观看| 亚洲成人你懂的| 91精品国产乱码久久蜜臀| 蜜臀av一区二区| 久久久久国产精品麻豆ai换脸| 国产高清久久久| 亚洲欧洲日产国产综合网| 欧美亚洲国产一区二区三区| 五月天激情综合网| 精品久久免费看| 成人中文字幕电影| 亚洲美女淫视频| 91.com在线观看| 国产一区二区三区在线观看免费视频| 久久久精品tv| 日本高清不卡视频| 日韩av在线发布| 国产欧美视频一区二区| 在线欧美小视频| 蜜桃av一区二区三区| 国产视频一区在线播放| 色综合色狠狠综合色| 日本欧美大码aⅴ在线播放| 久久久亚洲欧洲日产国码αv| 97久久精品人人爽人人爽蜜臀| 一二三区精品视频| 精品黑人一区二区三区久久| 不卡一区二区三区四区| 亚洲成人1区2区| 国产欧美精品日韩区二区麻豆天美| 91在线精品一区二区| 男女男精品视频| 国产精品国模大尺度视频| 欧美日韩成人一区| 国产99久久久精品| 亚洲国产日韩一级| 久久精品日产第一区二区三区高清版| 91免费观看国产| 久88久久88久久久| 亚洲人成网站色在线观看| 欧美一区二区三区影视| 国产91综合一区在线观看| 亚洲v日本v欧美v久久精品| 国产亚洲欧美色| 欧美一级片在线观看| 91免费视频网址| 国产精品白丝jk黑袜喷水| 亚洲午夜影视影院在线观看| 国产精品污污网站在线观看| 欧美一区二区视频观看视频| 色中色一区二区| 国产麻豆91精品| 日韩在线一区二区| 1024亚洲合集| 久久久久久99精品| 在线播放91灌醉迷j高跟美女| 91美女在线看| 国产精品1区2区3区在线观看| 日韩精品乱码av一区二区| ...av二区三区久久精品| 久久综合久久99| 欧美乱妇一区二区三区不卡视频| 成人av网站免费观看| 久久精品国产99国产精品| 亚洲午夜三级在线| 国产精品福利在线播放| 精品999在线播放| 制服丝袜亚洲色图| 欧美在线观看视频一区二区三区| 成人综合婷婷国产精品久久| 黑人巨大精品欧美黑白配亚洲| 午夜精品一区二区三区免费视频| 亚洲欧美另类久久久精品2019| 国产亚洲精品超碰| 欧美变态tickling挠脚心| 欧美群妇大交群中文字幕| 色视频成人在线观看免| 波多野结衣中文一区| 国产.精品.日韩.另类.中文.在线.播放| 琪琪久久久久日韩精品| 午夜av一区二区| 亚洲一区二区三区四区在线免费观看| 国产精品九色蝌蚪自拍| 中文字幕国产一区| 国产蜜臀97一区二区三区| 久久久精品免费观看| 国产视频在线观看一区二区三区 | 日韩va亚洲va欧美va久久| 午夜欧美电影在线观看|