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

C++ xml::ElementEnumerator类代码示例

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

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



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

示例1: loadRigid

void Framework::loadRigid( MyGUI::xml::ElementPtr node,JointPtr parent )
{
    ObjectFactory& factory = ObjectFactory::getSingleton();
    RigidPtr rgp = boost::dynamic_pointer_cast<Rigid>(factory.createObject("Rigid"));
    if(rgp)
    {
        rgp->load(node);
        if( parent )
        {
            parent->mRigid[1] = rgp;
            parent->linkRigid(parent->mRigid[0], parent->mRigid[1]);
        }
        MyGUI::xml::ElementEnumerator ce = node->getElementEnumerator();
        while(ce.next())
        {
            MyGUI::xml::ElementPtr child = ce.current();
            if( child->getName() == "joint" )
            {
                loadJoint( child,rgp );
            }
        }
    }
    else
    {
        WARNING_LOG("Factory can't make Rigid object!");
    }
}
开发者ID:JohnCrash,项目名称:iRobot,代码行数:27,代码来源:Framework.cpp


示例2: deserialization

	void SkinItem::deserialization(MyGUI::xml::Element* _node, MyGUI::Version _version)
	{
		mName = _node->findAttribute("name");

		mStates.destroyAllChilds();
		mSeparators.destroyAllChilds();
		mRegions.destroyAllChilds();

		MyGUI::xml::ElementEnumerator nodes = _node->getElementEnumerator();
		while (nodes.next())
		{
			MyGUI::xml::Element* node = nodes.current();

			if (node->getName() == "PropertySet")
			{
				mPropertySet->deserialization(node, _version);
			}
			else if (node->getName() == "StateItem")
			{
				StateItem* item = mStates.createChild();
				item->deserialization(node, _version);
			}
			else if (node->getName() == "SeparatorItem")
			{
				SeparatorItem* item = mSeparators.createChild();
				item->deserialization(node, _version);
			}
			else if (node->getName() == "RegionItem")
			{
				RegionItem* item = mRegions.createChild();
				item->deserialization(node, _version);
			}
		}
	}
开发者ID:LiberatorUSA,项目名称:GUCEF,代码行数:34,代码来源:SkinItem.cpp


示例3: loadJoint

void Framework::loadJoint( MyGUI::xml::ElementPtr node,RigidPtr parent )
{
    ObjectFactory& factory = ObjectFactory::getSingleton();
    string typeName = node->findAttribute("type");
    JointPtr jpt = boost::dynamic_pointer_cast<Joint>(factory.createObject(typeName));
    if(jpt)
    {
        if( parent )
        {
            jpt->mRigid[0] = parent;
        }
        addJoint(jpt);
        jpt->load(node);
        MyGUI::xml::ElementEnumerator ce = node->getElementEnumerator();
        while(ce.next())
        {
            MyGUI::xml::ElementPtr child = ce.current();
            if( child->getName() == "rigid" )
            {
                loadRigid(child, jpt);
            }
            break;
        }
    }
    else
    {
        WARNING_LOG("Factory can't make "<<typeName);
    }
}
开发者ID:JohnCrash,项目名称:iRobot,代码行数:29,代码来源:Framework.cpp


示例4: setupResources

void MYGUIManager::setupResources()
{
    MyGUI::xml::Document doc;
    if ( !_platform || !doc.open(_resourcePathFile) ) doc.getLastError();
    
    MyGUI::xml::ElementPtr root = doc.getRoot();
    if ( root==nullptr || root->getName()!="Paths" ) return;
    
    MyGUI::xml::ElementEnumerator node = root->getElementEnumerator();
    while ( node.next() )
    {
        if ( node->getName()=="Path" )
        {
			bool root = false, recursive = false;
			if (!node->findAttribute("root").empty())
            {
                root = MyGUI::utility::parseBool( node->findAttribute("root") );
                if ( root ) _rootMedia = node->getContent();
            }
			if (!node->findAttribute("recursive").empty())
			{
				recursive = MyGUI::utility::parseBool(node->findAttribute("recursive"));
			}
			_platform->getDataManagerPtr()->addResourceLocation(node->getContent(), recursive);
        }
    }
}
开发者ID:acmepjz,项目名称:turning-polyhedron-reloaded,代码行数:27,代码来源:MYGUIManager.cpp


示例5: loadValues

	void WidgetTypes::loadValues(MyGUI::xml::ElementPtr _node, const std::string& _file, MyGUI::Version _version)
	{
		MyGUI::xml::ElementEnumerator widgets = _node->getElementEnumerator();
		while (widgets.next("Value"))
		{
			std::string name = widgets->findAttribute("name");
			PossibleValue* possible_value = getPossibleValue(name);

			// тип мерджа переменных
			std::string merge = widgets->findAttribute("merge");
			// дополняем своими данными, по дефолту
			if (merge == "add")
			{
			}
			// удаляем и добавляем свои
			else if (merge == "replace")
			{
				possible_value->values.clear();
			}

			// берем детей и крутимся
			MyGUI::xml::ElementEnumerator field = widgets->getElementEnumerator();
			while (field.next())
			{
				std::string key, value;

				if (field->getName() == "Property")
				{
					if (!field->findAttribute("key", key))
						continue;
					possible_value->values.push_back(MyGUI::LanguageManager::getInstance().replaceTags(key));
				}
			}
		}
	}
开发者ID:LiberatorUSA,项目名称:GUCEF,代码行数:35,代码来源:WidgetTypes.cpp


示例6: deserialization

	void FadeNodeAnimator::deserialization(MyGUI::xml::ElementPtr _node, MyGUI::Version _version)
	{
		MyGUI::xml::ElementEnumerator node = _node->getElementEnumerator();
		while (node.next("Property"))
		{
			const std::string& key = node->findAttribute("key");
			const std::string& value = node->findAttribute("value");

			if (key == "FadeDuration") mFadeDuration = MyGUI::utility::parseFloat(value);
			else if (key == "FadeType") mFadeType = MyGUI::utility::parseInt(value);//FIXME
		}
	}
开发者ID:Anomalous-Software,项目名称:mygui,代码行数:12,代码来源:FadeNodeAnimator.cpp


示例7: deserialization

	void WobbleNodeAnimator::deserialization(MyGUI::xml::ElementPtr _node, MyGUI::Version _version)
	{
		MyGUI::xml::ElementEnumerator node = _node->getElementEnumerator();
		while (node.next("Property"))
		{
			const std::string& key = node->findAttribute("key");
			const std::string& value = node->findAttribute("value");

			if (key == "DragStrength") mDragStrength = MyGUI::utility::parseFloat(value);
			else if (key == "ResizeStrength") mResizeStrength = MyGUI::utility::parseFloat(value);
		}
	}
开发者ID:sskoruppa,项目名称:Glove_Code,代码行数:12,代码来源:WobbleNodeAnimator.cpp


示例8: deserialization

	void RTTLayer::deserialization(xml::ElementPtr _node, Version _version)
	{
		Base::deserialization(_node, _version);

		MyGUI::xml::ElementEnumerator propert = _node->getElementEnumerator();
		while (propert.next("Property"))
		{
			const std::string& key = propert->findAttribute("key");
			const std::string& value = propert->findAttribute("value");
			if (key == "TextureSize") setTextureSize(utility::parseValue<IntSize>(value));
			if (key == "TextureName") setTextureName(value);
		}
	}
开发者ID:sskoruppa,项目名称:Glove_Code,代码行数:13,代码来源:MyGUI_RTTLayer.cpp


示例9: load

	void EditorState::load()
	{
		SkinManager::getInstance().clear();

		MyGUI::xml::Document doc;
		if (doc.open(mFileName))
		{
			bool result = false;
			MyGUI::xml::Element* root = doc.getRoot();
			if (root->getName() == "Root")
			{
				MyGUI::xml::ElementEnumerator nodes = root->getElementEnumerator();
				while (nodes.next("SkinManager"))
				{
					SkinManager::getInstance().deserialization(nodes.current(), MyGUI::Version());
					result = true;

					if (mFileName != mDefaultFileName)
						RecentFilesManager::getInstance().addRecentFile(mFileName);

					break;
				}
			}

			if (!result)
			{
				/*MyGUI::Message* message =*/ MessageBoxManager::getInstance().create(
					replaceTags("Error"),
					replaceTags("MessageIncorrectFileFormat"),
					MyGUI::MessageBoxStyle::IconError
						| MyGUI::MessageBoxStyle::Yes);

				mFileName = mDefaultFileName;
				addUserTag("CurrentFileName", mFileName);

				updateCaption();
			}
		}
		else
		{
			/*MyGUI::Message* message =*/ MessageBoxManager::getInstance().create(
				replaceTags("Error"),
				doc.getLastError(),
				MyGUI::MessageBoxStyle::IconError
					| MyGUI::MessageBoxStyle::Yes);
		}

		ActionManager::getInstance().setChanges(false);
	}
开发者ID:siangzhang,项目名称:starworld,代码行数:49,代码来源:EditorState.cpp


示例10: convertProjectName

	MyGUI::UString EditorState::convertProjectName(const MyGUI::UString& _fileName)
	{
		size_t pos = mFileName.find_last_of("\\/");
		MyGUI::UString shortName = pos == MyGUI::UString::npos ? mFileName : mFileName.substr(pos + 1);
		addUserTag("ResourceName", shortName);

		size_t index = _fileName.find("|");
		if (index == MyGUI::UString::npos)
			return _fileName;

		MyGUI::UString fileName = _fileName.substr(0, index);
		MyGUI::UString itemIndexName = _fileName.substr(index + 1);
		size_t itemIndex = MyGUI::utility::parseValue<size_t>(itemIndexName);

		MyGUI::xml::Document doc;
		if (!doc.open(fileName))
			return _fileName;

		MyGUI::xml::ElementPtr root = doc.getRoot();
		if ((nullptr == root) || (root->getName() != "MyGUI"))
			return _fileName;

		if (root->findAttribute("type") == "Resource")
		{
			// берем детей и крутимся
			MyGUI::xml::ElementEnumerator element = root->getElementEnumerator();
			while (element.next("Resource"))
			{
				if (element->findAttribute("type") == "ResourceLayout")
				{
					if (itemIndex == 0)
					{
						// поменять на теги
						std::string resourceName = element->findAttribute("name");
						addUserTag("ResourceName", resourceName);
						return MyGUI::utility::toString(fileName, " [", resourceName, "]");
					}
					else
					{
						itemIndex --;
					}
				}
			}
		}

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


示例11: if

	ResourceItemInfo::ResourceItemInfo(MyGUI::xml::ElementEnumerator _node, MyGUI::Version _version) :
		IResource(_node, _version)
	{
		MyGUI::xml::ElementEnumerator node = _node->getElementEnumerator();
		while (node.next()) {
			if (node->getName() == "Name") mItemName = node->getContent();
			else if (node->getName() == "Description") mItemDescription = node->getContent();
			else if (node->getName() == "Image") mItemResourceImage = node->findAttribute("RefID");
		};
	}
开发者ID:venkatarajasekhar,项目名称:viper,代码行数:10,代码来源:ResourceItemInfo.cpp


示例12: Setup

		//--------------------------------------------------------------------------------
		void System::Setup()
		{

			MyGUI::xml::Document doc;

			if (!doc.open(std::string("resources.xml")))
				doc.getLastError();

			MyGUI::xml::ElementPtr root = doc.getRoot();
			if (root == nullptr || root->getName() != "Paths")
				return;

			MyGUI::xml::ElementEnumerator node = root->getElementEnumerator();
			while (node.next())
			{
				if (node->getName() == "Path")
				{
					bool root = false;
					if (node->findAttribute("root") != "")
					{
						root = MyGUI::utility::parseBool(node->findAttribute("root"));
						if (root) mRootMedia = node->getContent();
					}
					mPlatform->getDataManagerPtr()->addResourceLocation(node->getContent(), false);
				}
			}
		}
开发者ID:679565,项目名称:SkyrimOnline,代码行数:28,代码来源:System.cpp


示例13: deserialization

	void ResourceSDLPointer::deserialization(MyGUI::xml::ElementPtr _node, MyGUI::Version _version)
	{
		Base::deserialization(_node, _version);

		MyGUI::xml::ElementEnumerator info = _node->getElementEnumerator();
		while (info.next())
		{
			if (info->getName() == "Property")
			{
				const std::string& key = info->findAttribute("key");

				if (key == "SourceFile")
				{
					//std::string path = MyGUI::DataManager::getInstance().getDataPath(info->getContent());
					//mCursorType = (size_t)LoadCursorFromFileA(path.c_str());
				}
				else if (key == "SourceSystem")
				{
					std::string value = info->getContent();
					if (value == "SDL_SYSTEM_CURSOR_ARROW")
						mCursorType = SDL_SYSTEM_CURSOR_ARROW;
					else if (value == "SDL_SYSTEM_CURSOR_IBEAM")
						mCursorType = SDL_SYSTEM_CURSOR_IBEAM;
					else if (value == "SDL_SYSTEM_CURSOR_WAIT")
						mCursorType = SDL_SYSTEM_CURSOR_WAIT;
					else if (value == "SDL_SYSTEM_CURSOR_CROSSHAIR")
						mCursorType = SDL_SYSTEM_CURSOR_CROSSHAIR;
					else if (value == "SDL_SYSTEM_CURSOR_SIZENWSE")
						mCursorType = SDL_SYSTEM_CURSOR_SIZENWSE;
					else if (value == "SDL_SYSTEM_CURSOR_SIZENESW")
						mCursorType = SDL_SYSTEM_CURSOR_SIZENESW;
					else if (value == "SDL_SYSTEM_CURSOR_SIZEWE")
						mCursorType = SDL_SYSTEM_CURSOR_SIZEWE;
					else if (value == "SDL_SYSTEM_CURSOR_SIZENS")
						mCursorType = SDL_SYSTEM_CURSOR_SIZENS;
					else if (value == "SDL_SYSTEM_CURSOR_SIZEALL")
						mCursorType = SDL_SYSTEM_CURSOR_SIZEALL;
					else if (value == "SDL_SYSTEM_CURSOR_NO")
						mCursorType = SDL_SYSTEM_CURSOR_NO;
					else if (value == "SDL_SYSTEM_CURSOR_HAND")
						mCursorType = SDL_SYSTEM_CURSOR_HAND;
				}
			}
		}
	}
开发者ID:DotWolff,项目名称:mygui,代码行数:45,代码来源:ResourceSDLPointer.cpp


示例14: setupResources

	void BaseManager::setupResources()
	{
		MyGUI::xml::Document doc;

		if (!doc.open(std::string("resources.xml")))
			doc.getLastError();

		MyGUI::xml::ElementPtr root = doc.getRoot();
		if (root == nullptr || root->getName() != "Paths")
			return;

		MyGUI::xml::ElementEnumerator node = root->getElementEnumerator();
		while (node.next())
		{
			if (node->getName() == "Path")
			{
				if (node->findAttribute("root") != "")
				{
					bool root = MyGUI::utility::parseBool(node->findAttribute("root"));
					if (root)
						mRootMedia = node->getContent();
				}
				addResourceLocation(node->getContent(), false);
			}
		}

		addResourceLocation(getRootMedia() + "/Common/Base");
	}
开发者ID:chena1982,项目名称:mygui,代码行数:28,代码来源:BaseManager.cpp


示例15: loadSettings

	void SettingsManager::loadSettings(const MyGUI::UString& _fileName, bool _internal)
	{
		std::string _instance = "Editor";

		MyGUI::xml::Document doc;
		if (_internal)
		{
			MyGUI::DataStreamHolder data = MyGUI::DataManager::getInstance().getData(_fileName);
			if (data.getData() != nullptr)
			{
				if (!doc.open(data.getData()))
				{
					MYGUI_LOGGING(LogSection, Error, _instance << " : " << doc.getLastError());
					return;
				}
			}
		}
		else
		{
			if (!doc.open(_fileName))
			{
				MYGUI_LOGGING(LogSection, Error, _instance << " : " << doc.getLastError());
				return;
			}
		}

		MyGUI::xml::ElementPtr root = doc.getRoot();
		if (!root || (root->getName() != "MyGUI"))
		{
			MYGUI_LOGGING(LogSection, Error, _instance << " : '" << _fileName << "', tag 'MyGUI' not found");
			return;
		}

		std::string type;
		if (root->findAttribute("type", type))
		{
			if (type == "Settings")
			{
				// берем детей и крутимся
				MyGUI::xml::ElementEnumerator field = root->getElementEnumerator();
				while (field.next())
					loadSector(field.current());
			}
		}
	}
开发者ID:wangyanxing,项目名称:Demi3D,代码行数:45,代码来源:SettingsManager.cpp


示例16: _load

void HotkeyManager::_load( MyGUI::xml::ElementPtr root,const string xml )
{
	if( root == nullptr || root->getName() != "HKS" )
	{
		WARNING_LOG("bad Hotkey config file "<<xml);
		return;
	}
	MyGUI::xml::ElementEnumerator node = root->getElementEnumerator();
	while( node.next() )
	{
		if( node->getName() == "hotkey" )
		{
			hotkey hk;
			if( !node->findAttribute("name",hk.mName) )
			{
				WARNING_LOG("Hotkey config file "<<xml<<" invalid hotkey node");
				continue;
			}
			node->findAttribute("caption",hk.mCaption);
			node->findAttribute("tip",hk.mTip);
			node->findAttribute("key",hk.mHotkey);
			hk.mSHotkey = getStandardHotkeyName(hk.mHotkey);
			mHotkeys.push_back( hk );
			//设置对应Widget的User string,便于其显示出正常的热键
			setWidgetHotkey( hk.mName,hk.mHotkey );
		}
	}
}
开发者ID:JohnCrash,项目名称:iRobot,代码行数:28,代码来源:HotkeyManager.cpp


示例17: deserialization

	void OverlappedLayer::deserialization(xml::ElementPtr _node, Version _version)
	{
		mName = _node->findAttribute("name");
		if (_version >= Version(1, 2))
		{
			MyGUI::xml::ElementEnumerator propert = _node->getElementEnumerator();
			while (propert.next("Property"))
			{
				const std::string& key = propert->findAttribute("key");
				const std::string& value = propert->findAttribute("value");
				if (key == "Pick") mIsPick = utility::parseValue<bool>(value);
			}
		}
		else
		{
			mIsPick = utility::parseBool(_version < Version(1, 0) ? _node->findAttribute("peek") : _node->findAttribute("pick"));
		}
	}
开发者ID:OndraK,项目名称:openmw,代码行数:18,代码来源:MyGUI_OverlappedLayer.cpp


示例18: deserialization

	void SettingsSector::deserialization(MyGUI::xml::Element* _node, MyGUI::Version _version)
	{
		mName = _node->getName();

		MyGUI::xml::ElementEnumerator prop = _node->getElementEnumerator();
		while (prop.next("Property"))
		{
			std::string key;
			if (!prop->findAttribute("key", key))
				continue;

			std::string value;
			if (!prop->findAttribute("value", value))
				continue;

			mProperties[key] = value;
		}
	}
开发者ID:fake-human,项目名称:HiveGame,代码行数:18,代码来源:SettingsSector.cpp


示例19: deserialization

    void ScalingLayer::deserialization(MyGUI::xml::ElementPtr _node, MyGUI::Version _version)
    {
        MyGUI::OverlappedLayer::deserialization(_node, _version);

        MyGUI::xml::ElementEnumerator info = _node->getElementEnumerator();
        while (info.next())
        {
            if (info->getName() == "Property")
            {
                const std::string& key = info->findAttribute("key");
                const std::string& value = info->findAttribute("value");

                if (key == "Size")
                {
                    mViewSize = MyGUI::IntSize::parse(value);
                }
            }
        }
    }
开发者ID:A1-Triard,项目名称:openmw,代码行数:19,代码来源:scalinglayer.cpp


示例20: exportSkin

	void ExportManager::exportSkin(const MyGUI::UString& _fileName)
	{
		MyGUI::xml::Document doc;
		MyGUI::xml::Element* root = doc.createRoot("Root");

		SkinManager::getInstance().serialization(root, MyGUI::Version());

		MyGUI::xml::Document docOut;
		docOut.createDeclaration();
		MyGUI::xml::Element* rootOut = docOut.createRoot("MyGUI");
		rootOut->addAttribute("type", "Resource");
		rootOut->addAttribute("version", "1.1");

		MyGUI::xml::ElementEnumerator skins = root->getElementEnumerator();
		while (skins.next())
			convertSkin(skins.current(), rootOut->createChild("Resource"));

		docOut.save(_fileName);
	}
开发者ID:siangzhang,项目名称:starworld,代码行数:19,代码来源:ExportManager.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ xml::ElementPtr类代码示例发布时间:2022-05-31
下一篇:
C++ xml::Document类代码示例发布时间: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