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


C++ XNode::GetFirstChild方法代码示例

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


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

示例1: Update

	g_int TransactionHandler::Update(XNode* pxUpdate, WebContext* pWebContext, FeatureClass* pFeatureClass)
	{
		int count = 0;

		GFilter* pFilter = NULL;
		XNode* pxFilter = pxUpdate->GetFirstChild("Filter");
		if(pxFilter!=NULL)
		{
			FilterFactory *factory = augeGetFilterFactoryInstance();
			FilterReader  *reader  = factory->CreateFilerReader(pFeatureClass->GetFields());
			pFilter = reader->Read((XElement*)pxFilter);
		}
		
		XNodeSet* pxPropertySet = NULL;
		pxPropertySet = pxUpdate->GetChildren("Property");
		if(pxPropertySet==NULL)
		{
			if(pFilter!=NULL)
			{
				pFilter->Release();
				pFilter = NULL;
			}
			pFeatureClass->Release();
			return AG_FAILURE;
		}
		
		const char* str= NULL;
		const char* fname = NULL;
		augeFieldType ftype = augeFieldTypeNone;

		GField* pField = NULL;
		GValue* pValue = NULL;
		EnumString* pFieldNames = new EnumString();
		EnumValue*  pValues = new EnumValue();

		XNode* pxName = NULL;
		XNode* pxValue = NULL;
		XNode* pxProp = NULL;
		pxPropertySet->Reset();
		while((pxProp = pxPropertySet->Next())!=NULL)
		{
			pxName = pxProp->GetFirstChild("Name");
			pxValue= pxProp->GetFirstChild("Value");
			fname = pxName->GetContent();

			pField = pFeatureClass->GetField(fname);
			if(pField==NULL)
			{
				continue;
			}

			ftype = pField->GetType();
			switch(ftype)
			{					 
			case augeFieldTypeShort:
				{
					str = pxValue->GetContent();
					pValue = new GValue((short)atoi(str));
				}
				break;
			case augeFieldTypeInt:
				{
					str = pxValue->GetContent();
					pValue = new GValue((int)atoi(str));
				}
				break;
			case augeFieldTypeLong:
				{
					str = pxValue->GetContent();
					pValue = new GValue((long)atoi(str));
				}
				break;
			case augeFieldTypeInt64:
				{
					str = pxValue->GetContent();
					pValue = new GValue((int64)atoi(str));
				}
				break;
			case augeFieldTypeFloat:
				{
					str = pxValue->GetContent();
					pValue = new GValue((float)atof(str));
				}
				break;
			case augeFieldTypeDouble:
				{
					str = pxValue->GetContent();
					pValue = new GValue((double)atof(str));
				}
				break;
			case augeFieldTypeChar:			 
				{
					str = pxValue->GetContent();
					pValue = new GValue(str[0]);
				}
				break;
			case augeFieldTypeString:
				{
					const char* text = pxValue->GetContent();
					if(text==NULL)
//.........这里部分代码省略.........
开发者ID:marsprj,项目名称:Auge.GIS,代码行数:101,代码来源:TransactionHandler.cpp


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