• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ VectorString类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中VectorString的典型用法代码示例。如果您正苦于以下问题:C++ VectorString类的具体用法?C++ VectorString怎么用?C++ VectorString使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1:

	const std::string& ExportDataManager::getDataPath(const std::string& _name)
	{
		static std::string path;
		VectorString result;
		common::VectorWString wresult;

		for (VectorArhivInfo::const_iterator item = mPaths.begin(); item != mPaths.end(); ++item)
		{
			common::scanFolder(wresult, (*item).name, (*item).recursive, MyGUI::UString(_name).asWStr(), true);
		}

		for (common::VectorWString::const_iterator item = wresult.begin(); item != wresult.end(); ++item)
		{
			result.push_back(MyGUI::UString(*item).asUTF8());
		}

		if (!result.empty())
		{
			path = result[0];
			if (result.size() > 1)
			{
				MYGUI_PLATFORM_LOG(Warning, "There are several files with name '" << _name << "'. '" << path << "' was used.");
				MYGUI_PLATFORM_LOG(Warning, "Other candidater are:");
				for (size_t index = 1; index < result.size(); index ++)
					MYGUI_PLATFORM_LOG(Warning, " - '" << result[index] << "'");
			}
		}

		return path;
	}
开发者ID:Anomalous-Software,项目名称:mygui,代码行数:30,代码来源:MyGUI_ExportDataManager.cpp


示例2: get_field

CDB::stringSeq* DAOProxy::get_string_seq (const char * propertyName)
{
    //ACS_TRACE("cdb::DAOProxy::get_string_seq");

    // check remote mode
    if (m_dao.ptr() != CDB::DAO::_nil()) 
	return m_dao->get_string_seq(propertyName);

    string value;
    try{
    get_field(propertyName, value);
    }catch(cdbErrType::CDBFieldDoesNotExistExImpl ex){
	throw ex.getCDBFieldDoesNotExistEx();
    }

    VectorString array;
    split(value.c_str(), array);

    CDB::stringSeq_var seq = new CDB::stringSeq();
    seq->length(array.size());

    CORBA::ULong i = 0;
    for (VectorString::const_iterator iter = array.begin();
	 iter != array.end(); iter++)
	{
	seq[i++] = CORBA::string_dup(iter->c_str());
	}

    return seq._retn();
}
开发者ID:,项目名称:,代码行数:30,代码来源:


示例3: split

VectorString UtilString::split(const string &str, const string &delim /* =  */, uint32_t maxSplits /* = 0 */)
{
	VectorString ret;

	uint32_t numSplits = 0;

	size_t start = 0;
	size_t pos = 0;
	do
	{
		pos = str.find_first_of(delim, start);
		if (pos == start)
		{
			ret.push_back("");
			start = pos + 1;
		}
		else if (pos == string::npos || (maxSplits && numSplits == maxSplits))
		{
			ret.push_back(str.substr(start));
			break;
		}
		else
		{
			ret.push_back(str.substr(start, pos - start));
			start = pos + 1;
		}

		++numSplits;

	} while (pos != string::npos);

	return ret;
}
开发者ID:,项目名称:,代码行数:33,代码来源:


示例4: loadLanguage

	void LanguageManager::loadLanguage(const VectorString & _list, const std::string & _group)
	{
		mMapLanguage.clear();

		for (VectorString::const_iterator iter=_list.begin(); iter!=_list.end(); ++iter) {
			loadLanguage(*iter, _group);
		}
	}
开发者ID:venkatarajasekhar,项目名称:viper,代码行数:8,代码来源:MyGUI_LanguageManager.cpp


示例5: GetFileData

bool DataMgr::LoadFromFile(const char *fileName)
{
	std::string temp = GetFileData(fileName);

	if (temp.empty())
		return false;

	std::vector<std::string> vec;
	int pos;
	const char LF = 0x0a;

	while(true)
	{
		if(temp.empty())
			break;
		pos = temp.find(LF);
		if(pos != -1)
		{
			vec.push_back(temp.substr(0,pos));
			temp = temp.substr(pos + 1);
		}
		else
		{
			vec.push_back(temp);
			temp = "";
		}
	}

	m_StringMap.clear();

	for(int i = 0;i < (int)vec.size();++i)
	{
		std::string & str = vec[i];
		temp = GetDecryptedStr(str.c_str(),str.size());
		VectorString vecSplit;
		SplitToList(temp,vecSplit,'=');
		if(vecSplit.size() != 2)
			continue;
		std::string keylower = vecSplit[0];
		ToLower(keylower);
		size_t len = keylower.size();
		size_t size = strlen(SAVE_TAG);
		size_t pos = keylower.find(SAVE_TAG);
		if (len >= size && pos == len-size)
			m_StringMap.insert(std::make_pair(keylower,vecSplit[1]));
	}

	m_save_file = fileName;

	return true;
}
开发者ID:guomars,项目名称:project,代码行数:51,代码来源:DataMgr.cpp


示例6:

	const std::string& HGEDataManager::getDataPath(const std::string& _name)
	{
		static std::string path;
		VectorString result;
		common::VectorWString wresult;

		for (VectorArhivInfo::const_iterator item = mPaths.begin(); item != mPaths.end(); ++item)
		{
			common::scanFolder(wresult, (*item).name, (*item).recursive, MyGUI::UString(_name).asWStr(), true);
		}

		for (common::VectorWString::const_iterator item = wresult.begin(); item != wresult.end(); ++item)
		{
			result.push_back(MyGUI::UString(*item).asUTF8());
		}

		path = result.size() == 1 ? result[0] : "";
		return path;
	}
开发者ID:piaoasd123,项目名称:Fwankie,代码行数:19,代码来源:MyGUI_HGEDataManager.cpp


示例7: while

	void SettingsManager::setValueList(const std::string& _path, const VectorString& _values)
	{
		if (!MyGUI::utility::endWith(_path, ".List"))
			return;

		std::string itemName = "Value";

		pugi::xml_node targetNode;

		pugi::xpath_node node = mUserDocument->document_element().select_single_node(_path.c_str());
		if (!node.node().empty())
		{
			targetNode = node.node();
			while (!targetNode.first_child().empty())
				targetNode.remove_child(targetNode.first_child());
		}
		else
		{
			std::vector<std::string> names;
			std::string delims("/");
			names = MyGUI::utility::split(_path, delims);

			pugi::xml_node currentNode = mUserDocument->document_element();
			for (std::vector<std::string>::const_iterator name = names.begin(); name != names.end(); name ++)
			{
				pugi::xml_node childNode = currentNode.child((*name).c_str());
				if (childNode.empty())
					childNode = currentNode.append_child((*name).c_str());

				currentNode = childNode;
			}

			targetNode = currentNode;
		}

		for (VectorString::const_iterator value = _values.begin(); value != _values.end(); value ++)
			targetNode.append_child(itemName.c_str()).text().set((*value).c_str());

		eventSettingsChanged(_path);
	}
开发者ID:chhawk,项目名称:MyGUI,代码行数:40,代码来源:SettingsManager.cpp


示例8:

	const VectorString& OgreDataManager::getDataListNames(const std::string& _pattern, bool _fullpath)
	{
		static VectorString result;
		result.clear();

		Ogre::FileInfoListPtr pFileInfo = Ogre::ResourceGroupManager::getSingleton().findResourceFileInfo(mGroup, _pattern);

		result.reserve(pFileInfo->size());

		for (Ogre::FileInfoList::iterator fi = pFileInfo->begin(); fi != pFileInfo->end(); ++fi )
		{
			if (fi->path.empty())
			{
				bool found = false;
				for (VectorString::iterator iter = result.begin(); iter != result.end(); ++iter)
				{
					if (*iter == fi->filename)
					{
						found = true;
						break;
					}
				}
				if (!found)
				{
					result.push_back(_fullpath ? fi->archive->getName() + "/" + fi->filename : fi->filename);
				}

			}
		}

		pFileInfo.setNull();

		return result;
	}
开发者ID:siangzhang,项目名称:starworld,代码行数:34,代码来源:MyGUI_OgreDataManager.cpp


示例9: setPropertyValueList

	void SettingsSector::setPropertyValueList(const MyGUI::UString& _propertyName, const VectorString& _propertyValues)
	{
		clearProperty(_propertyName);
		for (size_t index = 0; index < _propertyValues.size(); ++ index)
			setPropertyValue(MyGUI::utility::toString(_propertyName, '.', index), _propertyValues[index]);
	}
开发者ID:fake-human,项目名称:HiveGame,代码行数:6,代码来源:SettingsSector.cpp


示例10:

	const VectorString& Ogre2DataManager::getDataListNames(const std::string& _pattern, bool _fullpath)
	{
		static VectorString result;
		result.clear();

		VectorString search;
		if (mAllGroups)
		{
			Ogre::StringVector sp = Ogre::ResourceGroupManager::getSingleton().getResourceGroups();
			search.reserve(sp.size());
			for (size_t i = 0; i < sp.size(); i++)
				search.push_back(sp[i]);
		}
		else
			search.push_back(mGroup);

		std::vector<Ogre::FileInfoListPtr> pFileInfos;

		int resultSize = 0;
		for (size_t i = 0; i < search.size(); i++)
		{
			Ogre::FileInfoListPtr pFileInfo = Ogre::ResourceGroupManager::getSingleton().findResourceFileInfo(search[i], _pattern);
			resultSize += pFileInfo->size();
			if (!pFileInfo->empty())
				pFileInfos.push_back(pFileInfo);
			else
				pFileInfo.setNull();
		}

		result.reserve(resultSize);

		for (size_t i = 0; i < pFileInfos.size(); i++)
		{
			Ogre::FileInfoListPtr pFileInfo = pFileInfos[i];
			for (Ogre::FileInfoList::iterator fi = pFileInfo->begin(); fi != pFileInfo->end(); ++fi )
			{
				if (fi->path.empty())
				{
					bool found = false;
					for (VectorString::iterator iter = result.begin(); iter != result.end(); ++iter)
					{
						if (*iter == fi->filename)
						{
							found = true;
							break;
						}
					}
					if (!found)
					{
						result.push_back(_fullpath ? fi->archive->getName() + "/" + fi->filename : fi->filename);
					}
				}
			}

			pFileInfo.setNull();
		}

		return result;
	}
开发者ID:DotWolff,项目名称:mygui,代码行数:59,代码来源:MyGUI_Ogre2DataManager.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ VectorT类代码示例发布时间:2022-05-31
下一篇:
C++ VectorSpace类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap