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

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

?? basicexcel.cpp

?? 對EXCEL的操作
?? CPP
?? 第 1 頁 / 共 5 頁
字號:
	for (size_t i=0; i<maxChildren; ++i) delete children_[i];
}
/********************************** End of Class PropertyTree ************************************/

/********************************** Start of Class CompoundFile ******************************/
// PURPOSE: Manage a compound file.
CompoundFile::CompoundFile() :
	block_(512), properties_(0), propertyTrees_(0),
	blocksIndices_(0), sblocksIndices_(0) {};

CompoundFile::~CompoundFile() {this->Close();}

/************************* Compound File Functions ***************************/
bool CompoundFile::Create(const wchar_t* filename)
// PURPOSE: Create a new compound 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.
{
	Close();
	file_.Create(filename);

	// Write compound file header
	header_ = Header();
	SaveHeader();

	// Save BAT
	blocksIndices_.clear();
	blocksIndices_.resize(128, -1);
	blocksIndices_[0] = -3;
	blocksIndices_[1] = -2;
	SaveBAT();

	// Save properties
	Property* root = new Property;
	wcscpy(root->name_, L"Root Entry");
	root->propertyType_ = 5;
	properties_.push_back(root);
	SaveProperties();

	// Set property tree
	propertyTrees_ = new PropertyTree;	
	propertyTrees_->parent_ = 0;
	propertyTrees_->self_ = properties_[0];
	propertyTrees_->index_ = 0;
	currentDirectory_ = propertyTrees_;

	return true;
}

bool CompoundFile::Open(const wchar_t* filename, ios_base::openmode mode)
// PURPOSE: Open an existing compound file.
// PROMISE: Return true if file is successfully opened, false if otherwise.
{
	Close();
	if (!file_.Open(filename, mode)) return false;
	
	// Load header
	if (!LoadHeader()) return false;

	// Load BAT information
	LoadBAT();	

	// Load properties
	propertyTrees_ = new PropertyTree;	
	LoadProperties();
	currentDirectory_ = propertyTrees_;

	return true;
}

bool CompoundFile::Close()
// PURPOSE: Close the opened compound file.
// PURPOSE: Reset BAT indices, SBAT indices, properties and properties tree information.
// PROMISE: Return true if file is successfully closed, false if otherwise.
{
	blocksIndices_.clear();
	sblocksIndices_.clear();

	size_t maxProperties = properties_.size();
	for (size_t i=0; i<maxProperties; ++i)
	{
		if (properties_[i]) delete properties_[i];
	}
	properties_.clear();

	if (propertyTrees_) 
	{
		delete propertyTrees_;
		propertyTrees_ = 0;
	}

	previousDirectories_.clear();
	currentDirectory_ = 0;

	return file_.Close();
}

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

/************************* Directory Functions ***************************/
int CompoundFile::ChangeDirectory(const wchar_t* path)
// PURPOSE: Change to a different directory in the compound file.
// PROMISE: Current directory will not be changed if directory is not present.
{
	previousDirectories_.push_back(currentDirectory_);

	// Handle special cases
	if (wcscmp(path, L".") == 0) 	
	{
		// Current directory
		previousDirectories_.pop_back();
		return SUCCESS;
	}
	if (wcscmp(path, L"..") == 0)
	{
		// Go up 1 directory
		if (currentDirectory_->parent_ != 0)
		{
			currentDirectory_ = currentDirectory_->parent_;
		}
		previousDirectories_.pop_back();
		return SUCCESS;
	}
	if (wcscmp(path, L"\\") == 0)
	{
		// Go to root directory
		currentDirectory_ = propertyTrees_;
		previousDirectories_.pop_back();
		return SUCCESS;
	}

	// Handle normal cases
	size_t ipos = 0;
	size_t npos = 0;
	size_t pathLength = wcslen(path);
	if (pathLength > 0 && path[0] == L'\\')
	{
		// Start from root directory
		currentDirectory_ = propertyTrees_;
		++ipos;
		++npos;
	}
	do
	{
		for (; npos<pathLength; ++npos)
		{
			if (path[npos] == L'\\') break; 
		}

		wchar_t* directory = new wchar_t[npos-ipos+1];
		copy (path+ipos, path+npos, directory);
		directory[npos-ipos] = 0;
		currentDirectory_ = FindProperty(currentDirectory_, directory);
		delete[] directory;
		ipos = npos + 1;
		npos = ipos;
		if (currentDirectory_ == 0)
		{
			// Directory not found
			currentDirectory_ = previousDirectories_.back();
			previousDirectories_.pop_back();
			return DIRECTORY_NOT_FOUND;
		}
	} while (npos < pathLength);
	previousDirectories_.pop_back();
	return SUCCESS;
}

int CompoundFile::MakeDirectory(const wchar_t* path)
// PURPOSE: Create a new directory in the compound file.
// PROMISE: Directory will not be created if it is already present or
// PROMISE: a file with the same name is present.
{
	previousDirectories_.push_back(currentDirectory_);
	Property* property = new Property;
	property->propertyType_ = 1;
	int ret = MakeProperty(path, property);
	currentDirectory_ = previousDirectories_.back();
	previousDirectories_.pop_back();
	SaveHeader();
	SaveBAT();
	SaveProperties();
	return ret;
}

int CompoundFile::PresentWorkingDirectory(wchar_t* path)
// PURPOSE: Get the full path of the current directory in the compound file.
// REQUIRE: path must be large enough to receive the full path information.
{
	previousDirectories_.push_back(currentDirectory_);
	vector<wchar_t> fullpath;
	do
	{
		size_t directoryLength = wcslen(currentDirectory_->self_->name_);
		vector<wchar_t> directory(directoryLength+1);
		directory[0] = L'\\';
		copy (currentDirectory_->self_->name_,
			  currentDirectory_->self_->name_+directoryLength,
			  directory.begin()+1);
		fullpath.insert(fullpath.begin(), directory.begin(), directory.end());		
	} while (currentDirectory_ = currentDirectory_->parent_);

	fullpath.erase(fullpath.begin(), fullpath.begin()+11);
	if (fullpath.empty()) fullpath.push_back(L'\\');
	copy (fullpath.begin(), fullpath.end(), path);
	path[fullpath.size()] = 0;
	currentDirectory_ = previousDirectories_.back();
	previousDirectories_.pop_back();
	return SUCCESS;
}

int CompoundFile::PresentWorkingDirectory(vector<wchar_t>& path)
// PURPOSE: Get the full path of the current directory in the compound file.
{
	previousDirectories_.push_back(currentDirectory_);
	path.clear();
	do
	{
		size_t directoryLength = wcslen(currentDirectory_->self_->name_);
		vector<wchar_t> directory(directoryLength+1);
		directory[0] = L'\\';
		copy (currentDirectory_->self_->name_,
			  currentDirectory_->self_->name_+directoryLength,
			  directory.begin()+1);
		path.insert(path.begin(), directory.begin(), directory.end());		
	} while (currentDirectory_ = currentDirectory_->parent_);

	path.erase(path.begin(), path.begin()+11);
	if (path.empty()) path.push_back(L'\\');
	currentDirectory_ = previousDirectories_.back();
	previousDirectories_.pop_back();
	return SUCCESS;
}

int CompoundFile::RemoveDirectory(const wchar_t* path)
// PURPOSE: Remove a directory in the compound file.
// PROMISE: Directory will not be removed if it has subdirectories or files under it.
{
	PropertyTree* directory = FindProperty(path);
	if (directory == 0) return DIRECTORY_NOT_FOUND;
	if (directory->self_->childProp_ != -1) return DIRECTORY_NOT_EMPTY;
	DeletePropertyTree(directory);
	SaveHeader();
	SaveBAT();
	SaveProperties();
	return SUCCESS;
}

int CompoundFile::DelTree(const wchar_t* path)
// PURPOSE: Remove everything in the path in the compound file, including
// PURPOSE: any files and subdirectories.
{
	previousDirectories_.push_back(currentDirectory_);
	PropertyTree* directory = FindProperty(path);
	if (directory == 0) return DIRECTORY_NOT_FOUND;
	if (directory->self_->childProp_ != -1)
	{
		size_t maxChildren = directory->children_.size();
		wchar_t* curpath = new wchar_t[65535];
		for (size_t i=0; i<maxChildren; ++i)
		{
			currentDirectory_ = directory->children_[i];
			PresentWorkingDirectory(curpath);
			if (directory->children_[i]->self_->propertyType_ == 1)
			{	
				// Directory
				DelTree(curpath);
			}
			else if (directory->children_[i]->self_->propertyType_ == 2)
			{
				// File
				RemoveFile(curpath);
			}
		}
		directory->self_->childProp_ = -1;
		delete[] curpath;
	}

	if (directory->self_->propertyType_ == 1)
	{	
		// Directory
		RemoveDirectory(path);
	}
	else if (directory->self_->propertyType_ == 2)
	{
		// File
		RemoveFile(path);
	}

	currentDirectory_ = previousDirectories_.back();
	previousDirectories_.pop_back();
	return SUCCESS;
}

int CompoundFile::DirectoryList(vector<vector<wchar_t> >& list, const wchar_t* path)
{
	previousDirectories_.push_back(currentDirectory_);
	if (path != 0)
	{
		int ret = ChangeDirectory(path);
		if (ret != SUCCESS) return ret;
	}
	list.clear();
	size_t maxChildren = currentDirectory_->children_.size();
	vector<wchar_t> name(32);
	for (size_t i=0; i<maxChildren; ++i)
	{
		wcscpy(&*(name.begin()), currentDirectory_->children_[i]->self_->name_);
		list.push_back(name);
	}
	currentDirectory_ = previousDirectories_.back();
	previousDirectories_.pop_back();
	return SUCCESS;
}


/************************* File Functions ***************************/
int CompoundFile::MakeFile(const wchar_t* path)
// PURPOSE: Create a new file in the compound file.
// PROMISE: File will not be created if it is already present or
// PROMISE: a directory with the same name is present.
{
	previousDirectories_.push_back(currentDirectory_);
	Property* property = new Property;
	property->propertyType_ = 2;
	int ret = MakeProperty(path, property);
	currentDirectory_ = previousDirectories_.back();
	previousDirectories_.pop_back();
	SaveHeader();
	SaveBAT();
	SaveProperties();
	return ret;
}

int CompoundFile::RemoveFile(const wchar_t* path)
// PURPOSE: Remove a file in the compound file.
{
	int ret = WriteFile(path, 0, 0);
	if (ret == SUCCESS) 
	{
		DeletePropertyTree(FindProperty(path));
		SaveHeader();
		SaveBAT();
		SaveProperties();
		return SUCCESS;
	}
	else return ret;
}

int CompoundFile::FileSize(const wchar_t* path, size_t& size)
// PURPOSE: Get the size of a file in the compound file.
// PROMISE: Return the data size stored in the Root Entry if path = "\".
// PROMISE: size will not be set if file is not present in the compound file.
{
	// Special case of reading root entry
	if (wcscmp(path, L"\\") == 0)
	{
		size = propertyTrees_->self_->size_;
		return SUCCESS;
	}
	
	// Check to see if file is present in the specified directory.
	PropertyTree* property = FindProperty(path);
	if (property == 0) return FILE_NOT_FOUND;
	else
	{
		size = property->self_->size_;
		return SUCCESS;
	}
}

int CompoundFile::ReadFile(const wchar_t* path, char* data)
// PURPOSE: Read a file's data in the compound file.
// REQUIRE: data must be large enough to receive the file's data.
// REQUIRE: The required data size can be obtained by using FileSize().
// PROMISE: Returns the small blocks of data stored by the Root Entry if path = "\".
// PROMISE: data will not be set if file is not present in the compound file.
{
	// Special case of reading root entry
	char* buffer;
	if (wcscmp(path, L"\\") == 0)
	{
		buffer = new char[DataSize(propertyTrees_->self_->startBlock_, true)];
		ReadData(propertyTrees_->self_->startBlock_, buffer, true);
		copy (buffer, buffer+propertyTrees_->self_->size_, data);
		delete[] buffer;
		return SUCCESS;
	}

	// Check to see if file is present in the specified directory.
	PropertyTree* property = FindProperty(path);
	if (property == 0) return FILE_NOT_FOUND;

	if (property->self_->size_ >= 4096)
	{
		// Data stored in normal big blocks
		buffer = new char[DataSize(property->self_->startBlock_, true)];
		ReadData(property->self_->startBlock_, buffer, true);
	}
	else
	{
		// Data stored in small blocks
		buffer = new char[DataSize(property->self_->startBlock_, false)];
		ReadData(property->self_->startBlock_, buffer, false);
	}
	// Truncated the retrieved data to the actual file size.
	copy (buffer, buffer+property->self_->size_, data);
	delete[] buffer;
	return SUCCESS;
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲大型综合色站| 国产精品九色蝌蚪自拍| 卡一卡二国产精品| 日韩天堂在线观看| 国产大陆精品国产| 中文字幕日本不卡| 91黄色免费看| 五月综合激情日本mⅴ| 日韩一区二区三区高清免费看看| 激情欧美一区二区| 国产精品不卡在线观看| 欧美自拍偷拍午夜视频| 视频一区中文字幕国产| 日韩免费看的电影| 懂色av一区二区三区蜜臀| 亚洲欧洲av在线| 欧美日韩一区中文字幕| 美腿丝袜亚洲一区| 中日韩av电影| 欧美日韩精品免费观看视频| 狠狠色综合播放一区二区| 国产精品国产自产拍在线| 欧美日韩中文字幕一区二区| 国产一区二区三区四区五区美女| 国产精品色哟哟| 4438成人网| 成人黄色在线看| 亚洲成人激情自拍| 国产色爱av资源综合区| 欧美日韩国产天堂| 成人免费高清视频在线观看| 亚洲444eee在线观看| 久久久久久久久久久99999| 欧美亚男人的天堂| 国产精品18久久久久久久久久久久| 成人欧美一区二区三区白人| 欧美一级片在线看| 色婷婷综合久久久久中文| 国产中文字幕精品| 亚洲成av人片观看| 中文字幕在线视频一区| 欧美一区欧美二区| 欧美在线视频全部完| 国产精品 日产精品 欧美精品| 亚洲不卡一区二区三区| 中文字幕亚洲欧美在线不卡| www国产成人免费观看视频 深夜成人网| 99re这里只有精品视频首页| 久久99最新地址| 五月婷婷综合网| 亚洲精品成人a在线观看| 久久影院午夜片一区| 91精品在线一区二区| 一本大道久久a久久综合| 福利一区福利二区| 国模一区二区三区白浆| 视频一区二区国产| 亚洲一区二区三区四区在线| 亚洲日本在线视频观看| 国产精品丝袜91| 久久久久久免费毛片精品| 欧美成人在线直播| 欧美一级片免费看| 日韩亚洲欧美在线| 91精品国产欧美一区二区18| 欧美日韩中文另类| 色av成人天堂桃色av| 91在线精品一区二区三区| 粉嫩aⅴ一区二区三区四区五区| 国产在线精品免费| 韩国精品主播一区二区在线观看| 日韩av电影免费观看高清完整版 | 成人久久18免费网站麻豆| 美国三级日本三级久久99| 日本美女视频一区二区| 男人的天堂亚洲一区| 日韩vs国产vs欧美| 免费不卡在线视频| 九九国产精品视频| 国产综合色视频| 风间由美性色一区二区三区| 国产精品一区免费在线观看| 国产成人在线视频网址| av毛片久久久久**hd| 成人成人成人在线视频| 97精品国产露脸对白| 日本福利一区二区| 欧美久久婷婷综合色| 91精品国产综合久久精品图片| 91精品国产色综合久久| 337p日本欧洲亚洲大胆精品 | 亚洲精品视频在线观看免费 | 亚洲高清不卡在线观看| 水蜜桃久久夜色精品一区的特点| 麻豆传媒一区二区三区| 国产白丝精品91爽爽久久 | 欧美日韩一区二区三区在线看| 欧美色网一区二区| 日韩色在线观看| 国产日韩精品一区二区三区 | 首页国产欧美日韩丝袜| 久久91精品久久久久久秒播 | 日本黄色一区二区| 欧美一区二区高清| 久久久久免费观看| 亚洲尤物视频在线| 国产一区二区免费在线| 97se亚洲国产综合在线| 欧美日韩中字一区| 久久影院午夜片一区| 亚洲激情校园春色| 精品一区二区在线视频| 97se亚洲国产综合在线| 欧美一区二区免费| 中文字幕在线观看不卡| 日韩国产欧美在线观看| 国产成人啪午夜精品网站男同| 一本一本大道香蕉久在线精品| 日韩视频一区二区三区| 亚洲欧美日韩中文字幕一区二区三区| 亚洲va欧美va天堂v国产综合| 国产一区二区三区四区在线观看 | 欧美精品v国产精品v日韩精品| 久久久久久免费| 亚洲成va人在线观看| 成人av片在线观看| 日韩精品一区二区在线观看| 亚洲欧美日韩国产综合| 国产精一品亚洲二区在线视频| 在线看日本不卡| 中文字幕不卡在线观看| 日韩电影在线免费看| 91国产视频在线观看| 国产三级精品三级在线专区| 五月天一区二区| 91丨porny丨国产入口| 精品人伦一区二区色婷婷| 亚洲激情图片qvod| 成人深夜视频在线观看| 日韩一区二区三区电影在线观看 | 欧美色老头old∨ideo| 国产日韩欧美精品在线| 免费人成在线不卡| 欧美视频中文字幕| 最新中文字幕一区二区三区| 国产永久精品大片wwwapp| 8v天堂国产在线一区二区| 亚洲精品国产精品乱码不99| 国产精品一区二区三区99| 日韩一区二区电影在线| 亚洲一级二级在线| 欧美综合一区二区| 亚洲三级电影网站| 99久久99久久免费精品蜜臀| 中文字幕不卡一区| 国产成人高清视频| 国产午夜精品一区二区| 国产精品一线二线三线精华| 精品国产亚洲一区二区三区在线观看| 亚洲成人手机在线| 欧美调教femdomvk| 亚洲一区二区三区视频在线播放 | 日本欧美加勒比视频| 制服丝袜中文字幕亚洲| 日韩专区一卡二卡| 欧美精品99久久久**| 视频精品一区二区| 日韩一区二区免费视频| 老司机精品视频导航| 2020国产精品自拍| 国产一区二区三区在线观看精品 | 99精品国产热久久91蜜凸| 国产精品私人影院| 97se亚洲国产综合自在线 | 中文字幕在线播放不卡一区| 国产aⅴ精品一区二区三区色成熟| 国产午夜精品美女毛片视频| 成人综合在线网站| 自拍偷拍国产亚洲| 欧美丝袜自拍制服另类| 男人的天堂久久精品| 精品国产乱码久久久久久浪潮| 久久不见久久见免费视频7 | 综合自拍亚洲综合图不卡区| 97久久超碰国产精品| 午夜一区二区三区在线观看| 欧美一区二区三区啪啪| 久久精品72免费观看| 亚洲精品一区二区三区蜜桃下载| 国产露脸91国语对白| 国产精品成人午夜| 欧美三级韩国三级日本一级| 美女网站一区二区| 国产精品午夜春色av| 欧美自拍丝袜亚洲| 男男成人高潮片免费网站| 久久久久九九视频| 色狠狠色狠狠综合| 蜜臀精品久久久久久蜜臀| 日本一区二区成人|