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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? basicexcelvc6.hpp

?? 對EXCEL的操作
?? HPP
?? 第 1 頁 / 共 3 頁
字號:
// 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
{
	#define READWRITE(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;	\
		}	\
	}	\
	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));	\
	}	\
	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;	\
		}	\
	}	\
	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));	\
	}	\
	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;	\
		}	\
	}	\
	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));	\
	}	\
	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;	\
		}	\
	}	\
	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));	\
	}	\

	READWRITE(char)
	READWRITE(unsigned char)
	READWRITE(short)
	READWRITE(int)
	READWRITE(unsigned int)
	READWRITE(long)
	READWRITE(unsigned long)
	READWRITE(__int64)
	READWRITE(unsigned __int64)

	#undef READWRITE


	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);

		__int64 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 Property& lhs, const Property& rhs) 
		{
			return (!wcscmp(lhs.name_, rhs.name_));
		}
		friend bool operator< (const Property& lhs, const 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 Property& lhs, const Property& rhs) {return !(lhs == rhs);}
		friend bool operator> (const Property& lhs, const Property& rhs) {return (rhs < lhs);}
		friend bool operator<=(const Property& lhs, const Property& rhs) {return !(rhs < lhs);}
		friend bool operator>=(const Property& lhs, const 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);
	void InsertPropertyTree(PropertyTree* parentTree, Property* property, size_t index);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美一级二级三级乱码| 国产精品久久久久久久久久久免费看 | 欧美日韩精品一区二区天天拍小说 | 精品国内二区三区| 亚洲天堂2014| 国产美女主播视频一区| 欧美三区免费完整视频在线观看| 久久嫩草精品久久久精品| 亚洲一区av在线| 9色porny自拍视频一区二区| 亚洲精品一区在线观看| 亚洲国产aⅴ成人精品无吗| 成人免费av资源| 久久夜色精品国产噜噜av| 日韩专区欧美专区| 欧洲精品视频在线观看| 亚洲丝袜自拍清纯另类| 国产精品12区| 精品国产乱码久久久久久浪潮| 亚洲chinese男男1069| 色94色欧美sute亚洲线路一ni | 国内精品国产成人国产三级粉色| 精品视频在线免费看| 亚洲欧美另类久久久精品2019| 国产精品一区二区三区网站| 欧美精品一区二区高清在线观看| 天天综合天天做天天综合| 欧美色国产精品| 亚洲一区在线看| 欧美午夜精品电影| 亚洲国产成人porn| 欧美日韩国产三级| 日韩福利电影在线| 日韩一区二区免费在线观看| 日韩国产一区二| 日韩女优av电影| 精品系列免费在线观看| 日韩一卡二卡三卡四卡| 精品一区二区久久| 国产亚洲短视频| 成人福利在线看| 亚洲精品免费视频| 欧美精品v日韩精品v韩国精品v| 亚洲综合视频在线| 欧美久久久一区| 精品一区二区三区在线观看| 久久噜噜亚洲综合| 成人国产精品免费网站| 亚洲精品中文字幕乱码三区| 欧美色视频在线| 麻豆国产精品一区二区三区| 久久久久久久精| 99久久精品免费观看| 亚洲精品免费在线| 欧美一区二区三区日韩视频| 精品一区二区三区影院在线午夜| 欧美国产日产图区| 在线观看国产一区二区| 美女在线一区二区| 中文欧美字幕免费| 欧美视频在线一区二区三区 | 成人a级免费电影| 亚洲人成精品久久久久久 | 中文字幕精品一区二区三区精品| 成人动漫视频在线| 亚洲午夜免费视频| 精品99999| a级精品国产片在线观看| 亚洲国产成人av网| 日本一区二区三区国色天香| 91丝袜高跟美女视频| 日日骚欧美日韩| 国产精品激情偷乱一区二区∴| 欧美专区日韩专区| 激情欧美一区二区| 亚洲一区在线观看免费 | 亚洲图片欧美色图| 久久久亚洲精品一区二区三区| 91玉足脚交白嫩脚丫在线播放| 日本中文字幕一区二区视频 | 欧美性xxxxx极品少妇| 国产91在线|亚洲| 婷婷夜色潮精品综合在线| 日本一区二区动态图| 日韩一级高清毛片| 欧美日韩一区二区在线观看 | 欧美日韩国产精品成人| www.欧美.com| 国产一二精品视频| 日韩黄色小视频| 一个色在线综合| 国产精品福利一区二区三区| 26uuu色噜噜精品一区| 欧美精品第1页| 欧洲亚洲国产日韩| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 日韩高清不卡在线| 亚洲成人tv网| 亚洲一区成人在线| 一级中文字幕一区二区| 亚洲视频一区二区在线| 中文字幕第一区| 久久久噜噜噜久噜久久综合| 欧美一级理论片| 9191精品国产综合久久久久久| 在线观看免费视频综合| 一本色道a无线码一区v| 99精品国产91久久久久久 | 中文字幕亚洲不卡| 欧美高清在线精品一区| 欧美国产禁国产网站cc| 国产精品系列在线| 国产精品久99| 一区二区在线观看免费| 一区二区在线观看视频在线观看| 中文字幕一区二区视频| 亚洲免费观看视频| 一区二区三区不卡在线观看| 一区二区三区在线播放| 亚洲午夜在线电影| 天天综合网天天综合色 | 亚洲国产精品视频| 日韩精品亚洲专区| 美国十次综合导航| 国产寡妇亲子伦一区二区| 成人在线一区二区三区| 成人avav影音| 色噜噜夜夜夜综合网| 欧洲生活片亚洲生活在线观看| 欧美肥胖老妇做爰| 精品sm捆绑视频| 亚洲三级免费观看| 视频一区欧美精品| 国内精品第一页| 色综合久久88色综合天天免费| 欧美午夜一区二区三区| 欧美成人精精品一区二区频| 国产日产欧美一区二区视频| 中文字幕综合网| 婷婷亚洲久悠悠色悠在线播放| 精品午夜一区二区三区在线观看| 高清av一区二区| 欧美午夜不卡视频| 欧美精品一区男女天堂| 亚洲欧美二区三区| 蜜臀91精品一区二区三区| 国产91色综合久久免费分享| 色综合久久88色综合天天免费| 91麻豆精品国产91久久久久久 | 无吗不卡中文字幕| 国产精品一区二区视频| 欧美亚洲丝袜传媒另类| 欧美精品一区男女天堂| 一卡二卡欧美日韩| 国产成人综合在线观看| 在线观看www91| 国产欧美精品国产国产专区 | 国产精品二区一区二区aⅴ污介绍| 亚洲一区二区在线观看视频 | 欧美性色欧美a在线播放| 精品噜噜噜噜久久久久久久久试看 | 国产精品卡一卡二| 日本欧美肥老太交大片| a美女胸又www黄视频久久| 日韩免费一区二区三区在线播放| 亚洲视频一二三区| 国产福利一区二区| 欧美蜜桃一区二区三区| 中文字幕精品一区二区三区精品| 男男视频亚洲欧美| 在线观看视频一区二区| 国产精品传媒入口麻豆| 国产在线视频精品一区| 欧美精品丝袜中出| 一区二区在线免费观看| 成人网在线播放| 精品成人佐山爱一区二区| 午夜欧美大尺度福利影院在线看| 成人av小说网| 国产喷白浆一区二区三区| 麻豆国产欧美一区二区三区| 欧美精品粉嫩高潮一区二区| 一区二区三区精品久久久| 成人美女视频在线观看18| 久久综合狠狠综合| 另类的小说在线视频另类成人小视频在线 | 成人黄页毛片网站| 久久视频一区二区| 精品一区二区三区免费| 日韩免费视频一区二区| 日本午夜精品视频在线观看| 欧美日韩黄视频| 一区二区三区免费| 色综合中文字幕国产 | 午夜精品久久久久久久99水蜜桃 | 成人天堂资源www在线| 国产三级欧美三级日产三级99| 另类专区欧美蜜桃臀第一页| 欧美一区二区三区不卡| 日韩精品久久久久久|