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

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

?? basicexcelvc6.cpp

?? 對EXCEL的操作
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
	header_.propertiesStart_ -= count;

	size_t maxProperties = properties_.size();
	// Change Root Entry start block
	if (!properties_.empty()) 
	{
		size_t count = 0;
		for (size_t j=0; j<maxIndices; ++j)
		{
			if (properties_[0]->startBlock_ > indices[j] &&
				properties_[0]->startBlock_ != -2) ++count;
		}
		properties_[0]->startBlock_ -= count;	
	}
	{for (size_t i=1; i<maxProperties; ++i)
	{
		if (properties_[i]->size_ >= 4096)
		{
			// Change individual properties start block if their size is more than 4096
			size_t count = 0;
			for (size_t j=0; j<maxIndices; ++j)
			{
				if (properties_[i]->startBlock_ > indices[j] &&
					properties_[i]->startBlock_ != -2) ++count;
			}
			properties_[i]->startBlock_ -= count;	
		}
	}}
}

void CompoundFile::SplitPath(const wchar_t* path, 
							 wchar_t*& parentpath, 
							 wchar_t*& propertyname)
// PURPOSE: Get a path's parent path and its name.
// EXPLAIN: E.g. path = "\\Abc\\def\\ghi => parentpath = "\\Abc\\def", propertyname = "ghi".
// REQUIRE: Calling function is responsible for deleting the memory created for
// REQUIRE: parentpath and propertyname.
{
	size_t pathLength = wcslen(path);

	int npos;
	for (npos=pathLength-1; npos>0; --npos)
	{
		if (path[npos] == L'\\') break; 
	}

	if (npos != 0)
	{
		// Get parent path if available
		parentpath = new wchar_t[npos+1];
		copy (path, path+npos, parentpath);
		parentpath[npos] = 0;
		++npos;
	}

	// Get property name (ignore initial "\" if present)
	if (npos==0 && pathLength > 0 && path[0] == L'\\') ++npos;
	propertyname = new wchar_t[pathLength-npos+1];
	copy (path+npos, path+pathLength, propertyname);
	propertyname[pathLength-npos] = 0;	
}

/*********************** Inaccessible Header Functions ***************************/
bool CompoundFile::LoadHeader()
// PURPOSE: Load header information for compound file.
// PROMISE: Return true if file header contain magic number, false if otherwise.
{
	file_.Read(0, &*(block_.begin()));
	header_.Read(&*(block_.begin()));

	// Check magic number to see if it is a compound file 
	if (header_.fileType_ != 0xE11AB1A1E011CFD0) return false;

	block_.resize(header_.bigBlockSize_);		// Resize buffer block
	file_.SetBlockSize(header_.bigBlockSize_);	// Resize block array block size
	return true;
}

void CompoundFile::SaveHeader()
// PURPOSE: Save header information for compound file.
{
	header_.Write(&*(block_.begin()));
	file_.Write(0, &*(block_.begin()));
}

/*********************** Inaccessible BAT Functions ***************************/
void CompoundFile::LoadBAT()
// PURPOSE: Load all block allocation table information for compound file.
{
	// Read BAT indices
	{for (size_t i=0; i<header_.BATCount_; ++i)
	{
		// Load blocksIndices_
		blocksIndices_.resize(blocksIndices_.size()+128, -1);
		file_.Read(header_.BATArray_[i]+1, &*(block_.begin()));
		for (size_t j=0; j<128; ++j) 
		{
			LittleEndian::Read(&*(block_.begin()), blocksIndices_[j+i*128], j*4, 4);
		}
	}}

	// Read XBAT indices
	{for (size_t i=0; i<header_.XBATCount_; ++i)
	{
		blocksIndices_.resize(blocksIndices_.size()+128, -1);
		file_.Read(header_.XBATStart_+i+1, &*(block_.begin()));
		for (size_t j=0; j<128; ++j) 
		{
			LittleEndian::Read(&*(block_.begin()), blocksIndices_[j+((i+109)*128)], j*4, 4);
		}
	}}

	// Read SBAT indices
	{for (size_t i=0; i<header_.SBATCount_; ++i)
	{
		sblocksIndices_.resize(sblocksIndices_.size()+128, -1);
		file_.Read(header_.SBATStart_+i+1, &*(block_.begin()));
		for (size_t j=0; j<128; ++j)
		{
			LittleEndian::Read(&*(block_.begin()), sblocksIndices_[j+i*128], j*4, 4);
		}
	}}
}

void CompoundFile::SaveBAT()
// PURPOSE: Save all block allocation table information for compound file.
{
	// Write BAT indices
	{for (size_t i=0; i<header_.BATCount_; ++i)
	{
		for (size_t j=0; j<128; ++j)
		{
			LittleEndian::Write(&*(block_.begin()), blocksIndices_[j+i*128], j*4, 4);
		}
		file_.Write(header_.BATArray_[i]+1, &*(block_.begin()));
	}}

	// Write XBAT indices
	{for (size_t i=0; i<header_.XBATCount_; ++i)
	{
		for (size_t j=0; j<128; ++j)
		{
			LittleEndian::Write(&*(block_.begin()), blocksIndices_[j+((i+109)*128)], j*4, 4);
		}
		file_.Write(header_.XBATStart_+i+1, &*(block_.begin()));
	}}

	// Write SBAT indices
	{for (size_t i=0; i<header_.SBATCount_; ++i)
	{
		for (size_t j=0; j<128; ++j)
		{
			LittleEndian::Write(&*(block_.begin()), sblocksIndices_[j+i*128], j*4, 4);
		}
		file_.Write(header_.SBATStart_+i+1, &*(block_.begin()));
	}}
}

size_t CompoundFile::DataSize(size_t startIndex, bool isBig)
// PURPOSE: Gets the total size occupied by a property, starting from startIndex.
// EXPLAIN: isBig is true if property uses big blocks, false if it uses small blocks.
// PROMISE: Returns the total size occupied by the property which is the total 
// PROMISE: number of blocks occupied multiply by the block size.
{
	vector<size_t> indices;
	if (isBig) 
	{
		GetBlockIndices(startIndex, indices, true);
		return indices.size()*header_.bigBlockSize_;
	}
	else 
	{
		GetBlockIndices(startIndex, indices, false);
		return indices.size()*header_.smallBlockSize_;
	}	
}

size_t CompoundFile::ReadData(size_t startIndex, char* data, bool isBig)
// PURPOSE: Read a property's data, starting from startIndex.
// REQUIRE: data must be large enough to receive the property's data
// REQUIRE: The required data size can be obtained by using DataSize().
// EXPLAIN: isBig is true if property uses big blocks, false if it uses small blocks.
// PROMISE: Returns the total size occupied by the property which is the total 
// PROMISE: number of blocks occupied multiply by the block size.
{
	vector<size_t> indices;
	if (isBig)
	{
		GetBlockIndices(startIndex, indices, true);
		size_t maxIndices = indices.size();
		for (size_t i=0; i<maxIndices; ++i)
		{
			file_.Read(indices[i]+1, data+i*header_.bigBlockSize_);
		}
		return maxIndices*header_.bigBlockSize_;
	}
	else
	{
		GetBlockIndices(startIndex, indices, false);
		size_t minIndex = *min_element(indices.begin(), indices.end());
		size_t maxIndex = *max_element(indices.begin(), indices.end());
		size_t smallBlocksPerBigBlock = header_.bigBlockSize_ / header_.smallBlockSize_;
		size_t minBlock = minIndex / smallBlocksPerBigBlock;
		size_t maxBlock = maxIndex / smallBlocksPerBigBlock + 
						  (maxIndex % smallBlocksPerBigBlock ? 1 : 0);
		size_t totalBlocks = maxBlock - minBlock;
		char* buffer = new char[DataSize(properties_[0]->startBlock_, true)];
		ReadData(properties_[0]->startBlock_, buffer, true);

		size_t maxIndices = indices.size();
		for (size_t i=0; i<maxIndices; ++i)
		{
			size_t start = (indices[i] - minBlock*smallBlocksPerBigBlock)*header_.smallBlockSize_;
			copy (buffer+start, 
				  buffer+start+header_.smallBlockSize_, 
				  data+i*header_.smallBlockSize_);
		}
		delete[] buffer;
		return maxIndices*header_.smallBlockSize_;
	}
}

size_t CompoundFile::WriteData(const char* data, size_t size, int startIndex, bool isBig)
// PURPOSE: Write data to a property, starting from startIndex.
// EXPLAIN: startIndex can be -2 if property initially has no data.
// EXPLAIN: isBig is true if property uses big blocks, false if it uses small blocks.
// PROMISE: The file's original data will be replaced by the new data.
// PROMISE: Returns the startIndex of new data for the property.
{
	if (isBig)
	{
		if (size==0 && startIndex==-2) return startIndex;

		// Get present indices
		vector<size_t> indices;
		GetBlockIndices(startIndex, indices, true);
		size_t maxPresentBlocks = indices.size();

		// Calculate how many blocks does the data need
		size_t extraSize = size % header_.bigBlockSize_;
		size_t maxNewBlocks = size / header_.bigBlockSize_ + (extraSize ? 1 : 0);

		// Readjust indices and remove blocks if new data size is smaller than original
		int extraBlocks = maxPresentBlocks - maxNewBlocks;
		if (extraBlocks > 0)
		{
			// Place new end marker
			if (maxNewBlocks != 0) blocksIndices_[indices[maxNewBlocks]-1] = -2;
			else startIndex = -2;

			// Get indices of blocks to delete
			vector<size_t> indicesToRemove(extraBlocks);
			copy (indices.begin()+maxNewBlocks, indices.end(), indicesToRemove.begin());
			indices.erase(indices.begin()+maxNewBlocks, indices.end());

			// Remove extra blocks and readjust indices
			FreeBlocks(indicesToRemove, true);
		}

		// Write blocks into available space
		size_t remainingFullBlocks = size / header_.bigBlockSize_;
		size_t curIndex=0;
		if (maxPresentBlocks != 0)
		{
			for (; remainingFullBlocks && curIndex<maxPresentBlocks; 
				   --remainingFullBlocks, ++curIndex)
			{
				file_.Write(indices[curIndex]+1, data+curIndex*header_.bigBlockSize_);			
			} 
		}
		
		// Check if all blocks have been written		
		size_t index;
		if (indices.empty()) index = 0;
		else if (curIndex == 0) index = indices[0];
		else index = (startIndex != -2) ? indices[curIndex-1] : 0;
		if (remainingFullBlocks != 0)
		{			
			// Require extra blocks to write data (i.e. new data is larger than original data
			do
			{
				size_t newIndex = GetFreeBlockIndex(true); // Get new free block to write data
				if (startIndex == -2) startIndex = newIndex; // Get start index
				else LinkBlocks(index, newIndex, true); // Link last index to new index
				file_.Write(newIndex+1, data+curIndex*header_.bigBlockSize_);
				++curIndex;			
				index = newIndex;
			} while (--remainingFullBlocks);
		}
		
		if (extraSize != 0)
		{
			size_t newIndex;
			if (curIndex >= maxPresentBlocks)
			{
				// No more free blocks to write extra block data
				newIndex = GetFreeBlockIndex(true); // Get new free block to write data			
				if (startIndex == -2) startIndex = newIndex;
				else LinkBlocks(index, newIndex,true);
			}
			else newIndex = indices[curIndex];

			// Write extra block after increasing its size to the minimum block size
			vector<char> tempdata(header_.bigBlockSize_, 0);
			copy (data+curIndex*header_.bigBlockSize_, data+curIndex*header_.bigBlockSize_+extraSize, tempdata.begin());
			file_.Write(newIndex+1, &*(tempdata.begin()));			
		}
		return startIndex;
	}
	else
	{
		if (size==0 && startIndex==-2) return startIndex;

		if (size != 0 && properties_[0]->startBlock_ == -2)
		{
			size_t newIndex = GetFreeBlockIndex(true);
			fill (block_.begin(), block_.end(), 0);
			file_.Insert(newIndex, &*(block_.begin()));
			IncreaseLocationReferences(vector<size_t>(1, newIndex));
			properties_[0]->startBlock_ = newIndex;
			properties_[0]->size_ = header_.bigBlockSize_;
		}

		// Get present indices
		vector<size_t> indices;
		GetBlockIndices(startIndex, indices, false);
		size_t maxPresentBlocks = indices.size();

		// Calculate how many blocks does the data need
		size_t extraSize = size % header_.smallBlockSize_;
		size_t maxNewBlocks = size / header_.smallBlockSize_ + (extraSize ? 1 : 0);

		vector<char> smallBlocksData;
		int extraBlocks = maxPresentBlocks - maxNewBlocks;
		if (extraBlocks > 0)
		{
			// Readjust indices and remove blocks
			// Place new end marker
			if (maxNewBlocks != 0) sblocksIndices_[indices[maxNewBlocks]-1] = -2;
			else startIndex = -2;

			// Get indices of blocks to delete
			vector<size_t> indicesToRemove(extraBlocks);
			copy (indices.begin()+maxNewBlocks, indices.end(), indicesToRemove.begin());
			indices.erase(indices.begin()+maxNewBlocks, indices.end());

			// Remove extra blocks and readjust indices
			FreeBlocks(indicesToRemove, false);
		}
		else if (extraBlocks < 0)
		{
			size_t maxBlocks = properties_[0]->size_ / header_.bigBlockSize_ +
						       (properties_[0]->size_ % header_.bigBlockSize_ ? 1 : 0);
			size_t actualSize = maxBlocks * header_.bigBlockSize_;
			smallBlocksData.resize(actualSize);	
			ReadData(properties_[0]->startBlock_, &*(smallBlocksData.begin()), true);
			smallBlocksData.resize(properties_[0]->size_);

			// Readjust indices and add blocks
			size_t newBlocksNeeded = -extraBlocks;
			size_t index = maxPresentBlocks - 1;
			for (size_t i=0; i<newBlocksNeeded; ++i)
			{
				size_t newIndex = GetFreeBlockIndex(false); // Get new free block to write data
				if (startIndex == -2) startIndex = newIndex; // Get start index
				else LinkBlocks(index, newIndex, false);  // Link last index to new index
				smallBlocksData.insert(smallBlocksData.begin()+newIndex,
									   header_.smallBlockSize_, 0);
				index = newIndex;
			}
			properties_[0]->size_ = newBlocksNeeded * header_.smallBlockSize_;
		}
		if (smallBlocksData.empty())
		{
			size_t maxBlocks = properties_[0]->size_ / header_.bigBlockSize_ +
						       (properties_[0]->size_ % header_.bigBlockSize_ ? 1 : 0);
			size_t actualSize = maxBlocks * header_.bigBlockSize_;
			smallBlocksData.resize(actualSize);	
			ReadData(properties_[0]->startBlock_, &*(smallBlocksData.begin()), true);
			smallBlocksData.resize(properties_[0]->size_);
		}

		// Write blocks
		GetBlockIndices(startIndex, indices, false);
		size_t fullBlocks = size / header_.smallBlockSize_;
		for (size_t i=0; i<fullBlocks; ++i)
		{
			copy (data+i*header_.smallBlockSize_,
				  data+i*header_.smallBlockSize_+header_.smallBlockSize_,
				  smallBlocksData.begin()+indices[i]*header_.smallBlockSize_);
		}
		if (extraSize != 0)
		{
			copy (data+fullBlocks*header_.smallBlockSize_,
				  data+fullBlocks*header_.smallBlockSize_+extraSize,
				  smallBlocksData.begin()+indices[fullBlocks]*header_.smallBlockSize_);
		}
		WriteData(&*(smallBlocksData.begin()), properties_[0]->size_,
				 properties_[0]->startBlock_, true);
		return startIndex;
	}
}

void CompoundFile::GetBlockIndices(size_t startIndex, vector<size_t>& indices, bool isBig)
// PURPOSE: Get the indices of blocks where data are stored, starting from startIndex.
// EXPLAIN: isBig is true if property uses big blocks, false if it uses small blocks.
{
	indices.clear();
	if (isBig)
	{
		for (size_t i=startIndex; i!=-2; i=blocksIndices_[i]) indices.push_back(i);
	}
	else 
	{
		for (size_t i=startIndex; i!=-2; i=sblocksIndices_[i]) indices.push_back(i);
	}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
在线亚洲免费视频| 欧美日韩国产综合久久| 91影院在线观看| 日韩亚洲欧美在线观看| 国产精品婷婷午夜在线观看| 亚洲在线观看免费视频| 国产成人h网站| 91精品婷婷国产综合久久性色 | 亚洲综合图片区| 国产在线国偷精品产拍免费yy| 欧美系列亚洲系列| 国产精品不卡一区二区三区| 久久精品国产亚洲5555| 欧美特级限制片免费在线观看| 欧美激情综合在线| 免费成人在线播放| 777奇米四色成人影色区| 亚洲精品免费电影| 成人h精品动漫一区二区三区| 日韩一区二区在线观看| 亚洲无线码一区二区三区| 成人一区二区三区视频在线观看 | 亚洲午夜三级在线| 粉嫩一区二区三区在线看| 日韩一区二区三区四区| 一区二区三区在线免费视频| 日韩国产欧美在线观看| 欧美午夜不卡视频| 一区二区免费视频| 色综合久久九月婷婷色综合| 国产欧美精品一区二区三区四区| 麻豆精品久久精品色综合| 欧美日韩不卡视频| 亚洲国产一区二区三区| 欧美少妇性性性| 亚洲国产日日夜夜| 777午夜精品视频在线播放| 亚洲一区二区在线免费看| 日本道色综合久久| 亚洲一线二线三线久久久| 久久综合资源网| 九九九久久久精品| 久久―日本道色综合久久| 精品一区二区三区久久| 欧美蜜桃一区二区三区| 午夜成人免费视频| 欧美高清hd18日本| 日韩精品亚洲专区| 日韩欧美的一区| 国产美女精品在线| 中文字幕二三区不卡| 成人污视频在线观看| 国产精品久久久久精k8| 日本久久一区二区| 亚洲一区二区三区四区中文字幕| 91福利精品第一导航| 亚洲午夜日本在线观看| 在线播放国产精品二区一二区四区| 亚洲自拍偷拍欧美| 欧美日韩成人在线| 精品在线亚洲视频| 国产日本欧美一区二区| 91亚洲精品久久久蜜桃网站 | 国产一区二区三区在线观看精品 | 欧美午夜视频网站| 三级欧美在线一区| 精品国产制服丝袜高跟| 国产成人综合在线观看| 国产精品萝li| 欧美日韩一区二区三区高清| 免费欧美在线视频| 久久久精品国产99久久精品芒果| av成人免费在线| 丝袜国产日韩另类美女| 国产日韩高清在线| 欧美日韩精品三区| 国产91精品一区二区| 亚洲超丰满肉感bbw| 国产日韩精品一区二区浪潮av| 国产午夜亚洲精品理论片色戒| 寂寞少妇一区二区三区| 91豆麻精品91久久久久久| 另类人妖一区二区av| 国产精品九色蝌蚪自拍| 欧美一区二区免费视频| 99免费精品视频| 老色鬼精品视频在线观看播放| 日本一区二区三区在线观看| 亚洲精品欧美综合四区| 7777精品久久久大香线蕉 | 亚洲一区二区三区四区在线观看| 日韩一卡二卡三卡四卡| 97成人超碰视| 久久9热精品视频| 亚洲最大色网站| 国产欧美综合色| 日韩欧美在线影院| 欧美在线制服丝袜| 懂色一区二区三区免费观看| 美女视频黄频大全不卡视频在线播放 | 中文字幕一区二区不卡| 欧美va亚洲va在线观看蝴蝶网| 色综合激情五月| 懂色av一区二区在线播放| 午夜激情一区二区| 亚洲精品videosex极品| 国产精品灌醉下药二区| 国产亚洲人成网站| 日韩欧美视频一区| 欧美日韩一区二区三区视频| 99国产精品久久| 国产成+人+日韩+欧美+亚洲| 久久99精品网久久| 青青草国产精品97视觉盛宴| 亚洲午夜久久久久久久久电影院| 欧美激情综合五月色丁香 | 欧美日韩高清在线播放| 99视频国产精品| 高清视频一区二区| 成人性生交大片| 成人av资源下载| av网站免费线看精品| 不卡的av电影| 99视频精品全部免费在线| 国产91精品一区二区麻豆网站| 国产一区二区三区四区五区美女| 久久精品国产在热久久| 美国十次综合导航| 麻豆免费精品视频| 国产一区免费电影| 国产福利不卡视频| 成人免费视频视频在线观看免费| 国产精品一卡二| 成人久久视频在线观看| 不卡一区在线观看| 91麻豆国产自产在线观看| 91色porny| 欧美另类一区二区三区| 欧美日韩国产免费| 欧美大片拔萝卜| 久久久久九九视频| 国产精品欧美经典| 亚洲美女视频一区| 亚洲国产精品久久一线不卡| 中文字幕一区二区三区av| 亚洲毛片av在线| 亚洲成在人线免费| 色婷婷久久久综合中文字幕| 91香蕉视频在线| 欧美日韩中文一区| 欧美一二三区精品| 久久精品亚洲乱码伦伦中文| 国产精品家庭影院| 亚洲mv在线观看| 九九国产精品视频| av综合在线播放| 欧美精品自拍偷拍| 久久久蜜桃精品| 一区二区三区四区在线| 日韩电影在线一区二区三区| 国产成人亚洲综合a∨猫咪| 91黄色免费版| 精品国产亚洲在线| 综合av第一页| 美女网站色91| 不卡的av电影在线观看| 777奇米成人网| 国产精品免费视频观看| 日韩国产欧美在线观看| 成人综合婷婷国产精品久久| 欧美日韩亚洲综合在线 欧美亚洲特黄一级| 欧美一卡在线观看| 国产精品情趣视频| 天天综合网 天天综合色| 成人综合在线网站| 日韩视频一区二区在线观看| 亚洲天堂av一区| 日韩av电影天堂| 91亚洲男人天堂| 26uuu亚洲综合色| 亚洲午夜在线视频| 国产白丝网站精品污在线入口| 欧美日韩视频不卡| 国产精品国产三级国产三级人妇| 三级欧美在线一区| 菠萝蜜视频在线观看一区| 欧美成人午夜电影| 亚洲制服丝袜av| 99视频精品在线| 国产日本欧美一区二区| 另类专区欧美蜜桃臀第一页| 日本道精品一区二区三区 | 国产精品乱码一区二区三区软件 | 亚洲丰满少妇videoshd| 99久久综合99久久综合网站| 亚洲成国产人片在线观看| 99久久久久久| 日本一区二区综合亚洲| 国产在线国偷精品产拍免费yy| 欧美日韩色综合|