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

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

?? basicexcelvc6.cpp

?? 對(duì)EXCEL的操作
?? CPP
?? 第 1 頁(yè) / 共 5 頁(yè)
字號(hào):
#include "BasicExcelVC6.hpp"

namespace YCompoundFiles
{
/********************************** Start of Class Block *************************************/
// PURPOSE: Manage a file by treating it as blocks of data of a certain size.
Block::Block() : 
	blockSize_(512), fileSize_(0), indexEnd_(0),
	filename_(0) {}

bool Block::Create(const wchar_t* filename)
// PURPOSE: Create a new block file and open it.
// PURPOSE: If file is present, truncate it and then open it.
// PROMISE: Return true if file is successfully created and opened, false if otherwise.
{
	// Create new file
	size_t filenameLength = wcslen(filename);
	char* name = new char[filenameLength+1];
	wcstombs(name, filename, filenameLength);
	name[filenameLength] = 0;

	file_.open(name, ios_base::out | ios_base::trunc);
	file_.close();
	file_.clear();

	// Open the file
	bool ret = this->Open(filename);
	delete[] name;
	return ret;
}

bool Block::Open(const wchar_t* filename, ios_base::openmode mode)
// PURPOSE: Open an existing block file.
// PROMISE: Return true if file is successfully opened, false if otherwise.
{
	// Open existing file for reading or writing or both
	size_t filenameLength = wcslen(filename);
	filename_.resize(filenameLength+1, 0);
	wcstombs(&*(filename_.begin()), filename, filenameLength);

	file_.open(&*(filename_.begin()), mode | ios_base::binary);
	if (!file_.is_open()) return false;

	mode_ = mode;
	
	// Calculate filesize
	if (mode & ios_base::in)
	{
		file_.seekg(0, ios_base::end);
		fileSize_ = file_.tellg();
	}
	else if (mode & ios_base::out)
	{
		file_.seekp(0, ios_base::end);
		fileSize_ = file_.tellp();
	}
	else
	{
		this->Close();
		return false;	
	}
	
	// Calculate last index + 1
	indexEnd_ = fileSize_/blockSize_ + (fileSize_ % blockSize_ ? 1 : 0);
	return true;
}

bool Block::Close()
// PURPOSE: Close the opened block file.
// PROMISE: Return true if file is successfully closed, false if otherwise.
{
	file_.close();
	file_.clear();
	filename_.clear(); 
	fileSize_ = 0; 
	indexEnd_ = 0; 
	blockSize_ = 512;
	return !file_.is_open();
}

bool Block::IsOpen()
// PURPOSE: Check if the block file is still opened.
// PROMISE: Return true if file is still opened, false if otherwise.
{
	return file_.is_open();
}

bool Block::Read(size_t index, char* block)
// PURPOSE: Read a block of data from the opened file at the index position.
// EXPLAIN: index is from [0..].
// PROMISE: Return true if data are successfully read, false if otherwise.
{
	if (!(mode_ & ios_base::in)) return false;
	if (index < indexEnd_)
	{
		file_.seekg(index * blockSize_);
		file_.read(block, blockSize_);
		return !file_.fail();
	}
	else return false;
}

bool Block::Write(size_t index, const char* block)
// PURPOSE: Write a block of data to the opened file at the index position.
// EXPLAIN: index is from [0..].
// PROMISE: Return true if data are successfully written, false if otherwise.
{
	if (!(mode_ & ios_base::out)) return false;
	file_.seekp(index * blockSize_);
	file_.write(block, blockSize_);
	if (indexEnd_ <= index) 
	{
		indexEnd_ = index + 1;
		fileSize_ += blockSize_;
	}
	file_.close();
	file_.clear();
	file_.open(&*(filename_.begin()), mode_ | ios_base::binary);
	return file_.is_open();		
}

bool Block::Swap(size_t index1, size_t index2)
// PURPOSE: Swap two blocks of data in the opened file at the index positions.
// EXPLAIN: index1 and index2 are from [0..].
// PROMISE: Return true if data are successfully swapped, false if otherwise.
{
	if (!(mode_ & ios_base::out)) return false;
	if (index1 < indexEnd_ && index2 < indexEnd_)
	{
		if (index1 == index2) return true;
		
		char* block1 = new char[blockSize_];
		if (!this->Read(index1, block1)) return false;
		
		char* block2 = new char[blockSize_];
		if (!this->Read(index2, block2)) return false;
		
		if (!this->Write(index1, block2)) return false;
		if (!this->Write(index2, block1)) return false;
		
		delete[] block1;
		delete[] block2;
		return true;
	}
	else return false;
}

bool Block::Move(size_t from, size_t to)
// PURPOSE: Move a block of data in the opened file from an index position to another index position.
// EXPLAIN: from and to are from [0..].
// PROMISE: Return true if data are successfully moved, false if otherwise.
{
	if (!(mode_ & ios_base::out)) return false;
	if (from < indexEnd_ && to < indexEnd_)
	{
		if (to > from)
		{
			for (size_t i=from; i!=to; ++i)
			{
				if (!this->Swap(i, i+1)) return false;	
			}
		}
		else
		{
			for (size_t i=from; i!=to; --i)
			{
				if (!this->Swap(i, i-1)) return false;	
			}
		}
		return true;	
	}
	else return false;
}

bool Block::Insert(size_t index, const char* block)
// PURPOSE: Insert a new block of data in the opened file at the index position.
// EXPLAIN: index is from [0..].
// PROMISE: Return true if data are successfully inserted, false if otherwise.
{
	if (!(mode_ & ios_base::out)) return false;
	if (index <= indexEnd_)
	{
		// Write block to end of file
		if (!this->Write(indexEnd_, block)) return false;

		// Move block to index if necessary
		if (index < indexEnd_-1) return this->Move(indexEnd_-1, index);
		else return true;
	}
	else 
	{
		// Write block to index after end of file
		return this->Write(index, block); 
	}
}

bool Block::Erase(size_t index)
// PURPOSE: Erase a block of data in the opened file at the index position.
// EXPLAIN: index is from [0..].
// PROMISE: Return true if data are successfully erased, false if otherwise.
{
	if (!(mode_ & ios_base::out)) return false;
	if (index < indexEnd_)
	{
		fileSize_ -= blockSize_;
		indexEnd_ -= 1;
		
		// Read entire file except the block to be deleted into memory.
		char* buffer = new char[fileSize_];
		for (size_t i=0, j=0; i!=indexEnd_+1; ++i) 
		{
			file_.seekg(i*blockSize_);
			if (i != index) 
			{
				file_.read(buffer+j*blockSize_, blockSize_);
				++j;
			}
		}
		file_.close();
		file_.open(&*(filename_.begin()), ios_base::out | ios_base::trunc | ios_base::binary);
		file_.write(buffer, fileSize_);	// Write the new file.
		file_.close();
		file_.open(&*(filename_.begin()), mode_ | ios_base::binary);
		delete[] buffer;
		return true;
	}
	else return false;
}

bool Block::Erase(vector<size_t>& indices)
// PURPOSE: Erase blocks of data in the opened file at the index positions.
// EXPLAIN: Each index in indices is from [0..].
// PROMISE: Return true if data are successfully erased, false if otherwise.
{
	if (!(mode_ & ios_base::out)) return false;

	// Read entire file except the blocks to be deleted into memory.
	size_t maxIndices = indices.size();
	fileSize_ -= maxIndices*blockSize_;
	char* buffer = new char[fileSize_];
	for (size_t i=0, k=0; i!=indexEnd_; ++i) 
	{
		file_.seekg(i*blockSize_);
		bool toDelete = false;
		for (size_t j=0; j<maxIndices; ++j)
		{
			if (i == indices[j])
			{
				toDelete = true;
				break;
			}
		}
		if (!toDelete) 
		{
			file_.read(buffer+k*blockSize_, blockSize_);
			++k;
		}
	}
	indexEnd_ -= maxIndices;
	
	file_.close();
	file_.open(&*(filename_.begin()), ios_base::out | ios_base::trunc | ios_base::binary);
	file_.write(buffer, fileSize_);	// Write the new file.
	file_.close();
	file_.open(&*(filename_.begin()), mode_ | ios_base::binary);
	delete[] buffer;
	return true;
}
/********************************** End of Class Block ***************************************/

/********************************** Start of Class Header ************************************/
// PURPOSE: Read and write data to a compound file header.
CompoundFile::Header::Header() : 
	fileType_(0xE11AB1A1E011CFD0),
	uk1_(0), uk2_(0), uk3_(0), uk4_(0), uk5_(0x003B), uk6_(0x0003), uk7_(-2),
	log2BigBlockSize_(9), log2SmallBlockSize_(6), 
	uk8_(0), uk9_(0), uk10_(0), uk11_(0x00001000),
	SBATStart_(-2), SBATCount_(0),
	XBATStart_(-2), XBATCount_(0),
	BATCount_(1), propertiesStart_(1) 
{
	BATArray_[0] = 0;	// Initial BAT indices at block 0 (=block 1 in Block)
	fill (BATArray_+1, BATArray_+109, -1);	// Rest of the BATArray is empty
	Initialize();
}

void CompoundFile::Header::Write(char* block)
// PURPOSE: Write header information into a block of data.
// REQUIRE: Block of data must be at least 512 bytes in size.
{
	LittleEndian::Write(block, fileType_, 0x0000, 8);
	LittleEndian::Write(block, uk1_, 0x0008, 4);
	LittleEndian::Write(block, uk2_, 0x000C, 4);
	LittleEndian::Write(block, uk3_, 0x0010, 4);
	LittleEndian::Write(block, uk4_, 0x0014, 4);
	LittleEndian::Write(block, uk5_, 0x0018, 2);
	LittleEndian::Write(block, uk6_, 0x001A, 2);
	LittleEndian::Write(block, uk7_, 0x001C, 2);
	LittleEndian::Write(block, log2BigBlockSize_, 0x001E, 2);
	LittleEndian::Write(block, log2SmallBlockSize_, 0x0020, 4);
	LittleEndian::Write(block, uk8_, 0x0024, 4);
	LittleEndian::Write(block, uk9_, 0x0028, 4);
	LittleEndian::Write(block, BATCount_, 0x002C, 4);
	LittleEndian::Write(block, propertiesStart_, 0x0030, 4);
	LittleEndian::Write(block, uk10_, 0x0034, 4);
	LittleEndian::Write(block, uk11_, 0x0038, 4);
	LittleEndian::Write(block, SBATStart_, 0x003C, 4);
	LittleEndian::Write(block, SBATCount_, 0x0040, 4);
	LittleEndian::Write(block, XBATStart_, 0x0044, 4);
	LittleEndian::Write(block, XBATCount_, 0x0048, 4);
	for (size_t i=0; i<109; ++i) LittleEndian::Write(block, BATArray_[i], 0x004C+i*4, 4);
}

void CompoundFile::Header::Read(char* block)
// PURPOSE: Read header information from a block of data.
// REQUIRE: Block of data must be at least 512 bytes in size.
{
	LittleEndian::Read(block, fileType_, 0x0000, 8);
	LittleEndian::Read(block, uk1_, 0x0008, 4);
	LittleEndian::Read(block, uk2_, 0x000C, 4);
	LittleEndian::Read(block, uk3_, 0x0010, 4);
	LittleEndian::Read(block, uk4_, 0x0014, 4);
	LittleEndian::Read(block, uk5_, 0x0018, 2);
	LittleEndian::Read(block, uk6_, 0x001A, 2);
	LittleEndian::Read(block, uk7_, 0x001C, 2);
	LittleEndian::Read(block, log2BigBlockSize_, 0x001E, 2);
	LittleEndian::Read(block, log2SmallBlockSize_, 0x0020, 4);
	LittleEndian::Read(block, uk8_, 0x0024, 4);
	LittleEndian::Read(block, uk9_, 0x0028, 4);
	LittleEndian::Read(block, BATCount_, 0x002C, 4);
	LittleEndian::Read(block, propertiesStart_, 0x0030, 4);
	LittleEndian::Read(block, uk10_, 0x0034, 4);
	LittleEndian::Read(block, uk11_, 0x0038, 4);
	LittleEndian::Read(block, SBATStart_, 0x003C, 4);
	LittleEndian::Read(block, SBATCount_, 0x0040, 4);
	LittleEndian::Read(block, XBATStart_, 0x0044, 4);
	LittleEndian::Read(block, XBATCount_, 0x0048, 4);
	for (size_t i=0; i<109; ++i) LittleEndian::Read(block, BATArray_[i], 0x004C+i*4, 4);
	Initialize();		
}

void CompoundFile::Header::Initialize()
{
	bigBlockSize_ = (size_t)pow(2.0, log2BigBlockSize_);		// Calculate each big block size.
	smallBlockSize_ = (size_t)pow(2.0, log2SmallBlockSize_);	// Calculate each small block size.
}
/********************************** End of Class Header **************************************/

/********************************** Start of Class Property **********************************/
// PURPOSE: Read and write data to a compound file property.
CompoundFile::Property::Property() :
	nameSize_(0),
	propertyType_(1), nodeColor_(1),
	previousProp_(-1), nextProp_(-1), childProp_(-1),
	uk1_(0), uk2_(0), uk3_(0), uk4_(0), uk5_(0),
	seconds1_(0), days1_(0), seconds2_(0), days2_(0),
	startBlock_(-2), size_(0)
{
	fill (name_, name_+32, 0);
}

void CompoundFile::Property::Write(char* block)
// PURPOSE: Write property information from a block of data.
// REQUIRE: Block of data must be at least 128 bytes in size.
{
	LittleEndian::WriteString(block, name_, 0x00, 32);
	LittleEndian::Write(block, nameSize_, 0x40, 2);
	LittleEndian::Write(block, propertyType_, 0x42, 1);
	LittleEndian::Write(block, nodeColor_, 0x43, 1);
	LittleEndian::Write(block, previousProp_, 0x44, 4);
	LittleEndian::Write(block, nextProp_, 0x48, 4);
	LittleEndian::Write(block, childProp_, 0x4C, 4);
	LittleEndian::Write(block, uk1_, 0x50, 4);
	LittleEndian::Write(block, uk2_, 0x54, 4);
	LittleEndian::Write(block, uk3_, 0x58, 4);
	LittleEndian::Write(block, uk4_, 0x5C, 4);
	LittleEndian::Write(block, uk5_, 0x60, 4);
	LittleEndian::Write(block, seconds1_, 0x64, 4);
	LittleEndian::Write(block, days1_, 0x68, 4);
	LittleEndian::Write(block, seconds2_, 0x6C, 4);
	LittleEndian::Write(block, days2_, 0x70, 4);
	LittleEndian::Write(block, startBlock_, 0x74, 4);
	LittleEndian::Write(block, size_, 0x78, 4);
}

void CompoundFile::Property::Read(char* block)
// PURPOSE: Read property information from a block of data.
// REQUIRE: Block of data must be at least 128 bytes in size.
{
	LittleEndian::ReadString(block, name_, 0x00, 32);
	LittleEndian::Read(block, nameSize_, 0x40, 2);
	LittleEndian::Read(block, propertyType_, 0x42, 1);
	LittleEndian::Read(block, nodeColor_, 0x43, 1);
	LittleEndian::Read(block, previousProp_, 0x44, 4);
	LittleEndian::Read(block, nextProp_, 0x48, 4);
	LittleEndian::Read(block, childProp_, 0x4C, 4);
	LittleEndian::Read(block, uk1_, 0x50, 4);
	LittleEndian::Read(block, uk2_, 0x54, 4);
	LittleEndian::Read(block, uk3_, 0x58, 4);
	LittleEndian::Read(block, uk4_, 0x5C, 4);
	LittleEndian::Read(block, uk5_, 0x60, 4);
	LittleEndian::Read(block, seconds1_, 0x64, 4);
	LittleEndian::Read(block, days1_, 0x68, 4);
	LittleEndian::Read(block, seconds2_, 0x6C, 4);
	LittleEndian::Read(block, days2_, 0x70, 4);
	LittleEndian::Read(block, startBlock_, 0x74, 4);
	LittleEndian::Read(block, size_, 0x78, 4);
}
/********************************** End of Class Property ************************************/

/********************************** Start of Class PropertyTree **********************************/
CompoundFile::PropertyTree::PropertyTree() {};

CompoundFile::PropertyTree::~PropertyTree()
{
	size_t maxChildren = children_.size();

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91一区二区在线| 色综合激情五月| 69堂国产成人免费视频| 亚洲精品国产精华液| 成人激情校园春色| 中文文精品字幕一区二区| 国内成人精品2018免费看| 欧美一区二区三区四区视频| 天堂久久久久va久久久久| 欧美三区在线观看| 一区二区视频在线| 91久久国产最好的精华液| 亚洲啪啪综合av一区二区三区| av一区二区三区在线| 国产精品午夜久久| 91丨国产丨九色丨pron| 亚洲乱码日产精品bd| 91蜜桃免费观看视频| 亚洲精品日韩一| 欧洲精品视频在线观看| 亚洲国产精品视频| 欧美剧在线免费观看网站| 日韩 欧美一区二区三区| 日韩精品在线网站| 精品一区免费av| 久久久久综合网| 成人动漫视频在线| 亚洲女厕所小便bbb| 欧洲亚洲国产日韩| 日本网站在线观看一区二区三区| 欧美电影免费观看高清完整版在 | 秋霞电影一区二区| 日韩欧美一区中文| 国产精品自拍一区| 中文乱码免费一区二区| 色成人在线视频| 丝瓜av网站精品一区二区| 欧美大胆人体bbbb| 国产精品一区2区| 中文字幕视频一区二区三区久| 一本久久a久久免费精品不卡| 亚洲成人午夜影院| 日韩免费视频一区| 成人一区在线看| 一区二区三区波多野结衣在线观看| 欧美日韩国产经典色站一区二区三区 | 中文字幕乱码日本亚洲一区二区| av网站一区二区三区| 亚洲一区中文日韩| 日韩免费性生活视频播放| 成熟亚洲日本毛茸茸凸凹| 一区2区3区在线看| 欧美电影免费观看高清完整版在线观看| 国产精品88av| 一区二区三区免费| 精品欧美一区二区三区精品久久| 成人小视频在线观看| 亚洲综合免费观看高清完整版 | 欧美精品在线视频| 国产精品亚洲一区二区三区在线| 亚洲免费观看高清完整版在线观看| 884aa四虎影成人精品一区| 国产精选一区二区三区| 一区二区三区视频在线看| 欧美成人在线直播| 色综合久久中文综合久久97| 蜜桃av一区二区在线观看| 中文字幕日韩精品一区| 欧美一级片在线观看| 成人国产精品免费观看动漫| 午夜亚洲福利老司机| 国产精品三级电影| 欧美一级一级性生活免费录像| 9久草视频在线视频精品| 秋霞电影一区二区| 亚洲免费电影在线| 久久综合成人精品亚洲另类欧美 | 亚洲人亚洲人成电影网站色| 日韩女优制服丝袜电影| 色哟哟一区二区三区| 国产在线精品免费| 亚洲国产精品久久人人爱 | 精品福利在线导航| 欧美在线free| 成人美女在线视频| 久久电影国产免费久久电影| 亚洲精品国产精华液| 欧美国产禁国产网站cc| 午夜精品成人在线视频| 国产日产欧美一区| 91精品国产福利| 91成人免费在线视频| 成人激情动漫在线观看| 美女视频黄 久久| 亚洲宅男天堂在线观看无病毒| 国产亚洲午夜高清国产拍精品| 欧美男男青年gay1069videost| k8久久久一区二区三区| 国产在线视视频有精品| 日本成人在线不卡视频| 亚洲一区二区三区免费视频| 国产精品久久久久久久久免费相片| 精品欧美一区二区久久| 欧美一区二区人人喊爽| 欧美日韩三级一区二区| 一本久道中文字幕精品亚洲嫩| 粉嫩一区二区三区在线看| 精品综合免费视频观看| 日本亚洲电影天堂| 日韩在线一区二区| 亚洲电影在线播放| 亚洲黄色尤物视频| 亚洲欧美日韩一区| 国产精品家庭影院| 欧美韩国日本综合| 国产偷国产偷亚洲高清人白洁| 日韩视频免费直播| 日韩一二三区视频| 91精品国产综合久久精品app| 欧美性大战xxxxx久久久| 一本大道综合伊人精品热热| av亚洲精华国产精华| 成人app网站| www.欧美色图| 99久久精品免费| av资源网一区| 99re这里只有精品首页| av欧美精品.com| 91亚洲男人天堂| 色综合久久六月婷婷中文字幕| 99在线热播精品免费| 91在线视频在线| 色噜噜狠狠成人中文综合| 色综合色狠狠综合色| 日本高清免费不卡视频| 欧洲亚洲精品在线| 欧美日韩国产免费一区二区| 制服.丝袜.亚洲.中文.综合| 欧美精品aⅴ在线视频| 91精品国产91综合久久蜜臀| 91精品国产91久久久久久最新毛片 | 欧美国产精品一区二区三区| 欧美激情一区在线观看| 亚洲欧洲日本在线| 亚洲欧洲制服丝袜| 亚洲成人动漫av| 免费观看一级欧美片| 韩国午夜理伦三级不卡影院| 国产乱码字幕精品高清av| 国产成人在线电影| 91视视频在线观看入口直接观看www | 欧美精品v国产精品v日韩精品| 91精品国产综合久久国产大片| 日韩欧美自拍偷拍| 国产丝袜欧美中文另类| 中文字幕一区二区三区乱码在线| 综合婷婷亚洲小说| 亚洲777理论| 老司机午夜精品| 国产91在线|亚洲| 91网上在线视频| 欧美伦理电影网| 精品免费视频.| 国产精品久久久一区麻豆最新章节| 亚洲女与黑人做爰| 日韩精品午夜视频| 国产精品影视在线| 一本色道a无线码一区v| 欧美一区二区高清| 亚洲国产精品av| 亚洲国产精品嫩草影院| 国产一区欧美一区| 色偷偷一区二区三区| 宅男噜噜噜66一区二区66| 久久久久久久久久美女| 综合电影一区二区三区| 人人爽香蕉精品| 国产91在线观看| 欧美精品在线观看一区二区| 久久久午夜电影| 亚洲综合视频在线观看| 精品亚洲成a人| 色婷婷av一区二区三区gif| 日韩欧美一级在线播放| 亚洲欧洲日韩av| 老司机精品视频一区二区三区| 成人高清伦理免费影院在线观看| 欧美精品第一页| 国产精品久久久久三级| 天堂一区二区在线| 岛国精品在线播放| 4438x亚洲最大成人网| 国产精品久久久久国产精品日日| 天堂资源在线中文精品| 成人97人人超碰人人99| 91精品国产aⅴ一区二区| 亚洲欧美日韩国产综合在线| 激情五月激情综合网| 欧美色老头old∨ideo| 欧美激情综合五月色丁香小说|