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

C++ XNode类代码示例

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

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



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

示例1: Load

void TitleSubst::Load(const std::string &filename, const std::string &section)
{
	XNode xml;
	if( !XmlFileUtil::LoadFromFileShowErrors(xml,filename) )
	{
		// LoadFromFile will show its own error
		//LOG->Trace("Error opening %s: %s", filename.c_str(), f.GetError().c_str() );
		return;
	}

	XNode *pGroup = xml.GetChild( section );
	if( pGroup == nullptr )
	{
		return;
	}
	for (auto const *child: *pGroup)
	{
		if( child == nullptr || child->GetName() != "Translation" )
		{
			continue;
		}
		TitleTrans tr;
		tr.LoadFromNode( child );
		AddTrans(tr);
	}
}
开发者ID:dguzek,项目名称:stepmania,代码行数:26,代码来源:TitleSubstitution.cpp


示例2:

   bool 
   RouteAddress::XMLStore(XNode *pParentNode, int iOptions)
   {
      XNode *pNode = pParentNode->AppendChild(_T("RouteAddress"));

      pNode->AppendAttr(_T("Name"), m_sAddress);

      return true;
   }
开发者ID:Bill48105,项目名称:hmailserver,代码行数:9,代码来源:RouteAddress.cpp


示例3: XNode

XNode* TapNote::CreateNode() const
{
	XNode *p = new XNode( "TapNote" );

	p->AppendChild( result.CreateNode() );
	p->AppendChild( HoldResult.CreateNode() );

	return p;
}
开发者ID:Highlogic,项目名称:stepmania-event,代码行数:9,代码来源:NoteTypes.cpp


示例4: CreateNode

XNode* SongID::CreateNode() const
{
	XNode* pNode = new XNode;
	pNode->name = "Song";

	pNode->AppendAttr( "Dir", sDir );

	return pNode;
}
开发者ID:Fighter19,项目名称:PSPMania,代码行数:9,代码来源:SongUtil.cpp


示例5: XNode

XNode* TrailID::CreateNode() const
{
	XNode* pNode = new XNode( "Trail" );

	pNode->AppendAttr( "StepsType", GAMEMAN->GetStepsTypeInfo(st).szName );
	pNode->AppendAttr( "CourseDifficulty", DifficultyToString(cd) );

	return pNode;
}
开发者ID:Highlogic,项目名称:stepmania-event,代码行数:9,代码来源:TrailUtil.cpp


示例6:

   bool 
   FetchAccountUID::XMLStore(XNode *pUIDsNode, int iOptions)
   {  
      XNode *pUIDNode = pUIDsNode->AppendChild(_T("UID"));
      
      pUIDNode->AppendAttr(_T("UID"), uid_);
      pUIDNode->AppendAttr(_T("Date"), date_);

      return true;
   }
开发者ID:AimaTeam-hehai,项目名称:hmailserver,代码行数:10,代码来源:FetchAccountUID.cpp


示例7:

   bool 
   BlockedAttachment::XMLStore(XNode *pParentNode, int iOptions)
   {
      XNode *pNode = pParentNode->AppendChild(_T("BlockedAttachment"));

      pNode->AppendAttr(_T("Name"), m_sWildcard);
      pNode->AppendAttr(_T("Description"), m_sDescription);

      return true;
   }
开发者ID:Bill48105,项目名称:hmailserver,代码行数:10,代码来源:BlockedAttachment.cpp


示例8: GetName

   bool 
   TCPIPPort::XMLStore(XNode *pParentNode, int iOptions)
   {
      XNode *pNode = pParentNode->AppendChild(_T("TCPIPPort"));

      pNode->AppendAttr(_T("Name"), GetName());
      pNode->AppendAttr(_T("PortProtocol"), StringParser::IntToString(m_iPortProtocol));
      pNode->AppendAttr(_T("PortNumber"), StringParser::IntToString(m_iPortNumber));
	  //JDR: added the following code to set if we are using a StartTLS connection.
	  if (m_bUseSSL == true){
		  pNode->AppendAttr(_T("UseSSL"), _T("1"));
	  } else if (m_bUseSTARTTLS == true){
		  LOG_DEBUG("Set UseSTARTLS");
		  pNode->AppendAttr(_T("UseSSL"), _T("2"));
	  } else {
		  pNode->AppendAttr(_T("UseSSL"), _T("0"));
	  }
      pNode->AppendAttr(_T("Address"), String(_address.ToString()));
      
      if (m_iSSLCertificateID > 0)
      {
         pNode->AppendAttr(_T("SSLCertificateName"), _GetSSLCertificateName(m_iSSLCertificateID));
      }

      return true;
   }
开发者ID:jrallo,项目名称:hMailServer,代码行数:26,代码来源:TCPIPPort.cpp


示例9:

   bool 
   SSLCertificate::XMLStore(XNode *pParentNode, int iOptions)
   {
      XNode *pNode = pParentNode->AppendChild(_T("SSLCertificate"));

      pNode->AppendAttr(_T("Name"), m_sName);
      pNode->AppendAttr(_T("CertificateFile"), m_sCertificateFile);
      pNode->AppendAttr(_T("PrivateKeyFile"), m_sPrivateKeyFile);

      return true;
   }
开发者ID:Bill48105,项目名称:hmailserver,代码行数:11,代码来源:SSLCertificate.cpp


示例10:

   bool 
   SSLCertificate::XMLStore(XNode *pParentNode, int iOptions)
   {
      XNode *pNode = pParentNode->AppendChild(_T("SSLCertificate"));

      pNode->AppendAttr(_T("Name"), name_);
      pNode->AppendAttr(_T("CertificateFile"), certificate_file_);
      pNode->AppendAttr(_T("PrivateKeyFile"), private_key_file_);

      return true;
   }
开发者ID:AimaTeam-hehai,项目名称:hmailserver,代码行数:11,代码来源:SSLCertificate.cpp


示例11:

   bool 
   ACLPermission::XMLStore(XNode *pParentNode, int iOptions)
   {
      XNode *pNode = pParentNode->AppendChild(_T("Permission"));

      pNode->AppendAttr(_T("Type"), StringParser::IntToString(m_iPermissionType));
      pNode->AppendAttr(_T("Rights"), StringParser::IntToString(m_iValue));
      pNode->AppendAttr(_T("Holder"), _GetPermissionHolderName(this));

      return true;
   }
开发者ID:bogri5520,项目名称:hMailServer,代码行数:11,代码来源:ACLPermission.cpp


示例12: CreateNode

XNode* CourseID::CreateNode() const
{
	XNode* pNode = new XNode;
	pNode->name = "Course";

	if( !sPath.empty() )
		pNode->AppendAttr( "Path", sPath );
	if( !sFullTitle.empty() )
		pNode->AppendAttr( "FullTitle", sFullTitle );

	return pNode;
}
开发者ID:augustg,项目名称:stepmania-3.9,代码行数:12,代码来源:CourseUtil.cpp


示例13: SaveEditableDataToDir

bool Profile::SaveAllToDir( CString sDir, bool bSignData ) const
{
	m_sLastPlayedMachineGuid = PROFILEMAN->GetMachineProfile()->m_sGuid;
	m_LastPlayedDate = DateTime::GetNowDate();

	// Save editable.xml
	SaveEditableDataToDir( sDir );

	// Save stats.xml
	CString fn = sDir + STATS_XML;

	XNode xml;
	xml.name = "Stats";
	xml.AppendChild( SaveGeneralDataCreateNode() );
	xml.AppendChild( SaveSongScoresCreateNode() );
	xml.AppendChild( SaveCourseScoresCreateNode() );
	xml.AppendChild( SaveCategoryScoresCreateNode() );
	xml.AppendChild( SaveScreenshotDataCreateNode() );
	xml.AppendChild( SaveCalorieDataCreateNode() );
	xml.AppendChild( SaveRecentSongScoresCreateNode() );
	xml.AppendChild( SaveRecentCourseScoresCreateNode() );
	if( IsMachine() )
		xml.AppendChild( SaveCoinDataCreateNode() );

	DISP_OPT opts = optDefault;
	opts.stylesheet = STATS_XSL;
	opts.write_tabs = false;
	bool bSaved = xml.SaveToFile(fn, &opts);
	
	// Update file cache, or else IsAFile in CryptManager won't see this new file.
	FILEMAN->FlushDirCache( sDir );
	
	if( bSaved && bSignData )
	{
		CString sStatsXmlSigFile = fn+SIGNATURE_APPEND;
		CryptManager::SignFileToFile(fn, sStatsXmlSigFile);

		// Update file cache, or else IsAFile in CryptManager won't see sStatsXmlSigFile.
		FILEMAN->FlushDirCache( sDir );

		// Save the "don't share" file
		CString sDontShareFile = sDir + DONT_SHARE_SIG;
		CryptManager::SignFileToFile(sStatsXmlSigFile, sDontShareFile);
	}

	SaveStatsWebPageToDir( sDir );

	// Empty directories if none exist.
	FILEMAN->CreateDir( sDir + EDITS_SUBDIR );
	FILEMAN->CreateDir( sDir + SCREENSHOTS_SUBDIR );

	return bSaved;
}
开发者ID:augustg,项目名称:stepmania-3.9,代码行数:53,代码来源:Profile.cpp


示例14:

   void
   BackupExecuter::_RestoreDataDirectory(shared_ptr<Backup> pBackup, XNode *pBackupNode)
   {
      XNode *pBackupInfoNode = pBackupNode->GetChild(_T("BackupInformation"));
      
      // Create the path to the zip file.
      String sBackupFile = pBackup->GetBackupFile();
      String sPath = sBackupFile.Mid(0, sBackupFile.ReverseFind(_T("\\")));

      String sDirContainingDataFiles;
      String sDataFileFormat = pBackupInfoNode->GetChildAttr(_T("DataFiles"), _T("Format"))->value;
      
      String sExtractedFilesDirectory;
      if (sDataFileFormat.CompareNoCase(_T("7Z")) == 0)
      {
         // Create the path to the directory that will contain the extracted files. 
         //  This directory is temporary and will be removed when we're done.
         sExtractedFilesDirectory = Utilities::GetUniqueTempDirectory();

         // Extract the files to this directory.
         Compression oComp;
         oComp.Uncompress(sBackupFile, sExtractedFilesDirectory);

         // The data files in the zip file are stored in
         // a directory called DataBackup.
         sDirContainingDataFiles = sExtractedFilesDirectory + "\\DataBackup";
      }
      else
      {
         // Fetch the path to the data files.
         String sFolderName = pBackupInfoNode->GetChildAttr(_T("DataFiles"), _T("FolderName"))->value;
         sDirContainingDataFiles = sPath + "\\" + sFolderName;
      }

      // Delete all directories from the data directory
      // so that we're sure that we're doing a clean restore
      String sDataDirectory = IniFileSettings::Instance()->GetDataDirectory();
      
      std::set<String> vecExcludes;
      FileUtilities::DeleteFilesInDirectory(sDataDirectory);
      FileUtilities::DeleteDirectoriesInDirectory(sDataDirectory, vecExcludes);

      String errorMessage;
      FileUtilities::CopyDirectory(sDirContainingDataFiles, sDataDirectory, errorMessage);

      if (sDataFileFormat.CompareNoCase(_T("7z")) == 0)
      {
         // The temporary directory we created while
         // unzipping should be deleted now.
         FileUtilities::DeleteDirectory(sExtractedFilesDirectory);
      }
   }
开发者ID:Bill48105,项目名称:hmailserver,代码行数:52,代码来源:BackupExecuter.cpp


示例15: XNode

XNode* StepsID::CreateNode() const
{
	XNode* pNode = new XNode( "Steps" );

	pNode->AppendAttr( "StepsType", GAMEMAN->GetStepsTypeInfo(st).szName );
	pNode->AppendAttr( "Difficulty", DifficultyToString(dc) );
	if( dc == Difficulty_Edit )
	{
		pNode->AppendAttr( "Description", sDescription );
		pNode->AppendAttr( "Hash", uHash );
	}

	return pNode;
}
开发者ID:Ancaro,项目名称:stepmania,代码行数:14,代码来源:StepsUtil.cpp


示例16: STATE_TEXT

bool ScreenArcadePatch::GetXMLData( RageFileDriverZip *fZip, CString &sGame, CString &sMessage, int &iRevision )
{
	int iError;
	RageFileBasic *fXML = fZip->Open( "patch.xml", RageFile::READ, iError );

	if( fXML == NULL )
	{
		STATE_TEXT( "Patch information check failed: could not open patch.xml." );
		return false;
	}

	/* check the actual XML data now */
	XNode *pNode = new XNode;
	pNode->m_sName = "Patch";
	pNode->LoadFromFile( *fXML );

	if( !pNode->GetChild("Game") || !pNode->GetChild("Revision") || !pNode->GetChild("Message") )
	{
		STATE_TEXT( "Patch information check failed: patch.xml is corrupt." );
		SAFE_DELETE( pNode );
		SAFE_DELETE( fXML );
		return false;
	}

	/* save the patch data */
	pNode->GetChild("Revision")->GetValue(iRevision);
	sGame = pNode->GetChildValue("Game");
	sMessage = pNode->GetChildValue("Message");

	SAFE_DELETE( pNode );
	SAFE_DELETE( fXML );

	return true;
}
开发者ID:Braunson,项目名称:openitg,代码行数:34,代码来源:ScreenArcadePatch.cpp


示例17: GetName

   bool 
   WhiteListAddress::XMLStore(XNode *pParentNode, int iOptions)
   {
      XNode *pNode = pParentNode->AppendChild(_T("WhiteAddress"));

      pNode->AppendAttr(_T("Name"), GetName());
      pNode->AppendAttr(_T("LowerIPAddress"), String(m_iWhiteLowerIPAddress.ToString()));
      pNode->AppendAttr(_T("UpperIPAddress"), String(m_iWhiteUpperIPAddress.ToString()));
      pNode->AppendAttr(_T("EMailAddress"), m_sWhiteEmailAddress);
      pNode->AppendAttr(_T("Description"), m_sWhiteDescription);

      return true;

      
   }
开发者ID:jrallo,项目名称:hMailServer,代码行数:15,代码来源:WhiteListAddress.cpp


示例18: XNode

XNode* HighScoreList::CreateNode() const
{
	XNode* pNode = new XNode( "HighScoreList" );

	pNode->AppendChild( "NumTimesPlayed", iNumTimesPlayed );
	pNode->AppendChild( "LastPlayed", dtLastPlayed.GetString() );
	if( HighGrade != Grade_NoData )
		pNode->AppendChild( "HighGrade", GradeToString(HighGrade) );

	for( unsigned i=0; i<vHighScores.size(); i++ )
	{
		const HighScore &hs = vHighScores[i];
		pNode->AppendChild( hs.CreateNode() );
	}

	return pNode;
}
开发者ID:KingMew,项目名称:stepmania,代码行数:17,代码来源:HighScore.cpp


示例19: ssprintf

void PlayerAI::InitFromDisk()
{
	IniFile ini;
	ini.ReadFile( AI_PATH );

	for( int i=0; i<NUM_SKILL_LEVELS; i++ )
	{
		CString sKey = ssprintf("Skill%d", i);
		XNode* pNode = ini.GetChild(sKey);
		if( pNode == NULL )
			RageException::Throw( "AI.ini: '%s' doesn't exist.", sKey.c_str() );

		TapScoreDistribution& dist = g_Distributions[i];
		dist.fPercent[TNS_NONE] = 0;
		pNode->GetAttrValue( "MissWeight", dist.fPercent[TNS_MISS] );
		pNode->GetAttrValue( "BooWeight", dist.fPercent[TNS_BOO] );
		pNode->GetAttrValue( "GoodWeight", dist.fPercent[TNS_GOOD] );
		pNode->GetAttrValue( "GreatWeight", dist.fPercent[TNS_GREAT] );
		pNode->GetAttrValue( "PerfectWeight", dist.fPercent[TNS_PERFECT] );
		pNode->GetAttrValue( "MarvelousWeight", dist.fPercent[TNS_MARVELOUS] );
		
		float fSum = 0;
		for( int j=0; j<NUM_TAP_NOTE_SCORES; j++ )
			fSum += dist.fPercent[j];
		for( int j=0; j<NUM_TAP_NOTE_SCORES; j++ )
			dist.fPercent[j] /= fSum;
	}
}
开发者ID:BitMax,项目名称:openitg,代码行数:28,代码来源:PlayerAI.cpp


示例20: augeGetFilterFactoryInstance

	OrderBy* GetFeatureRequest::ParserOrderBy(XElement* pxOrderBy)
	{
		OrderBy* pOrderBy = NULL;
		FilterFactory* pFilterFactory = augeGetFilterFactoryInstance();

		if(!pxOrderBy->HasChildren())
		{
			return NULL;
		}

		pOrderBy = pFilterFactory->CreateOrderBy();

		char field_name[AUGE_NAME_MAX];
		const char* property_name = NULL;
		XNode* pxNode = NULL;
		XNodeSet* pxNodeSet = pxOrderBy->GetChildren("PropertyName");

		pxNodeSet->Reset();
		while((pxNode=pxNodeSet->Next())!=NULL)
		{
			property_name = pxNode->GetContent();
			if(strlen(property_name)>0)
			{
				ParseFieldName(property_name, field_name, AUGE_NAME_MAX);
				pOrderBy->AddField(field_name);
			}
		}
		pxNodeSet->Release();

		XAttribute* pxAttr = pxOrderBy->GetAttribute("order");
		if(pxAttr!=NULL)
		{
			const char* order = pxAttr->GetValue();
			if(order!=NULL)
			{
				if(g_stricmp(order,"desc")==0)
				{
					pOrderBy->SetOrder(augeOrderDesc);
				}
				//pxAttr->Release();
			}
		}
		return pOrderBy;
	}
开发者ID:marsprj,项目名称:Auge.GIS,代码行数:44,代码来源:GetFeatureRequest.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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