当前位置: 首页>>代码示例>>C++>>正文


C++ Folder::getName方法代码示例

本文整理汇总了C++中Folder::getName方法的典型用法代码示例。如果您正苦于以下问题:C++ Folder::getName方法的具体用法?C++ Folder::getName怎么用?C++ Folder::getName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Folder的用法示例。


在下文中一共展示了Folder::getName方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: addFolder

void Folder::addFolder(Folder& f, bool copy)
{
	int position = containsFolder(f);
	if(position != -1)
	{
		cout<<"The folder '"<<f.getName()<<"' already exists in the current folder.";
		system("pause");
	}
	else
	{
		if(folderCount == folderCapacity)
		{
			increaseFolderCapacity();
		}
		if(copy)
		{
			*nestedFolders[folderCount] = f;
			nestedFolders[folderCount]->parentFolder = this;
		}
		else
		{
			f.parentFolder = this;
			nestedFolders[folderCount] = &f;
		}
		folderCount++;
	}
}
开发者ID:NikolaIliev,项目名称:FileSystemConsole,代码行数:27,代码来源:Folder.cpp

示例2: FirstSynchro

void Synchro::FirstSynchro()
{
	GetJSON();
	std::map<int, Folder *> FolderMap = myparse.getFoldermap();
	typedef std::map<int, Folder *>::iterator it_type2;
	for (it_type2 iterator = FolderMap.begin(); iterator != FolderMap.end(); iterator++) {
		Folder *fold = iterator->second;
		std::string str = this->folder + fold->getChosenPath() + "/" + fold->getName();
		char *cstr = new char[str.length() + 1];
		strcpy(cstr, str.c_str());
		if (QDir(cstr).exists() == true)
			return;
		else
			QDir().mkdir(cstr);
		delete[] cstr;
	}

	std::map<int, File *> fileMap = myparse.getFileMap();
	std::string StrignUpload = "uploads/";
	typedef std::map<int, File *>::iterator it_type;
	for (it_type iterator = fileMap.begin(); iterator != fileMap.end(); iterator++) {
		File *test = iterator->second;
		std::string urltodown = this->URL + StrignUpload + test->getPseudoOwner() + "/" + test->getRealPath() + test->getPath();
		while (urltodown.find('\\') != std::string::npos)
			replace(urltodown, "\\", "/");
		char *cstr1 = new char[urltodown.length() + 1];
		strcpy(cstr1, urltodown.c_str());

		std::string str = test->getName() + "." + test->getMimeType();
		char *cstr = new char[str.length() + 1];
		strcpy(cstr, str.c_str());

		str = this->folder + test->getChosenPath() + "/";
		char *pathDisk = new char[str.length() + 1];
		strcpy(pathDisk, str.c_str());

		std::string ty = pathDisk + str;
		QString URI(ty.c_str());
		DownloadFile(cstr1, URI);

		delete[] cstr;
		delete[] cstr1;
	}

	char acsjson[1024];
	strcpy(acsjson, this->folder);
	strcat(acsjson, ".acsilserver");
	QFile txt(acsjson);

	txt.open(QIODevice::ReadWrite | QIODevice::Text);
	txt.write(myparse.getJSON().c_str());
	txt.close();
}
开发者ID:eohland,项目名称:acsilserver,代码行数:53,代码来源:Synchro.cpp

示例3: playFolder

void LibSpotifyPlaybackHandler::playFolder(const Folder& folder)
{
    mtx_.lock();
    playQueue_.clear();
    currentlyPlayingFromName_ = folder.getName();
    currentlyPlayingFromUri_ = ""; //Unknown so far as how to get the folder link..
    currentlyPlayingFromType_ = FOLDER;
    folder.getAllTracks(playQueue_);
    playQueueIter_ = playQueue_.begin();
    if(enquedQueue_.empty())libSpotifyIf_.playTrack(playQueue_.front());
    mtx_.unlock();
}
开发者ID:,项目名称:,代码行数:12,代码来源:

示例4: containsFolder

int Folder::containsFolder(const Folder& f) const
{
	int contains = -1;
	for(int i = 0; i < folderCount; i++)
	{
		if(!strcmp(nestedFolders[i]->getName(), f.getName()))
		{
			contains = i;
			break;
		}
	}
	return contains;
}
开发者ID:NikolaIliev,项目名称:FileSystemConsole,代码行数:13,代码来源:Folder.cpp

示例5: removeFolderPointer

bool Folder::removeFolderPointer(Folder& f)
{
	bool removed = false;
	int position = containsFolder(f);
	if(position == -1)
	{
		cout<<"The folder '"<<f.getName()<<"' you are trying to delete does not exist in the current location.\n";
		system("pause");
	}
	else
	{
		if(folderCount == folderCapacity / 4)
		{
			decreaseFolderCapacity();
		}
		for(int i = position; i < folderCount - 1; i++)
		{
			nestedFolders[i] = nestedFolders[i + 1];
		}
		folderCount--;
		removed = true;
	}
	return removed;
}
开发者ID:NikolaIliev,项目名称:FileSystemConsole,代码行数:24,代码来源:Folder.cpp

示例6: ComparatifRenameFodler

void Synchro::ComparatifRenameFodler(QDateTime delta)
{
	qDebug() << delta.toString();
	std::map<int, Folder *> FolderMap = myparse.getFoldermap();
	typedef std::map<int, Folder *>::iterator it_type2;

	std::map<int, Folder *> OldFolderMap = oldparse.getFoldermap();
	typedef std::map<int, Folder *>::iterator it_type;

	QStringList ListNew, ListOld;

	for (it_type2 iterator = FolderMap.begin(); iterator != FolderMap.end(); iterator++) {

		Folder *fold = iterator->second;
		ListNew.push_back((this->folder + fold->getChosenPath() + fold->getName()).c_str());
		QString d = QString::fromStdString(fold->getLastModifDate());
		long long r = QDateTime::fromString(d, "yyyy:MM:dd hh:mm:ss").msecsTo(delta);
		if (r < 0)
		{
			std::string tmppath = this->folder + fold->getChosenPath() + fold->getName();
			QString path(tmppath.c_str());

			qDebug() << "Directory updated: " << path;

			for (it_type iterator2 = OldFolderMap.begin(); iterator2 != OldFolderMap.end(); iterator2++) {
				Folder *oldfold = iterator2->second;

				if (oldfold->getId() == fold->getId())
				{
					std::string oldpath = this->folder + oldfold->getChosenPath() + oldfold->getName();
					qDebug() << "Directory Old: " << oldpath.c_str();
					if ((oldfold->getName() != fold->getName()) || (oldpath != path.toStdString()))
					{
						QString original = (this->folder + oldfold->getChosenPath() + oldfold->getName()).c_str();
						QString dest = (this->folder + fold->getChosenPath() + fold->getName()).c_str();
						QDir dir;
						if (!dir.rename(original, dest)){
							qDebug() << "OOOOOOO SECOURSSSSSSSS";

						}
					}
				}
			}
		}
		else
		{

		}
	}
	for (it_type iterator2 = OldFolderMap.begin(); iterator2 != OldFolderMap.end(); iterator2++) {
		Folder *oldfold = iterator2->second;
		ListOld.push_back((this->folder + oldfold->getChosenPath() + oldfold->getName()).c_str());
	}

	QStringList currEntryList = ListNew;

	QStringList newEntryList = ListOld;
	QSet<QString> newDirSet = QSet<QString>::fromList(newEntryList);
	QSet<QString> currentDirSet = QSet<QString>::fromList(currEntryList);
	// Files that have been added
	QSet<QString> newFiles = newDirSet - currentDirSet;
	QStringList newFile = newFiles.toList();
	// Files that have been removed
	QSet<QString> deletedFiles = currentDirSet - newDirSet;
	QStringList deleteFile = deletedFiles.toList();
	if (!deleteFile.isEmpty())
	{
		qDebug() << "Files/Dirs deleted: " << deleteFile;
		foreach(QString file, deleteFile)
		{
			if (QDir(file).exists() == true)
				return;
			else
				QDir().mkdir(file);
		}
	}
开发者ID:eohland,项目名称:acsilserver,代码行数:76,代码来源:Synchro.cpp


注:本文中的Folder::getName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。