如何将列表(C ++列表)值解析或保存到XML文件 [英] How to parse or save the List (C++ List) values to XML file

查看:109
本文介绍了如何将列表(C ++列表)值解析或保存到XML文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友,

我面临将List值保存到XML文件到特定位置的问题.
我将一些原型代码用于获取需要以xml格式/文件保存的列表数据.

Hello Friends,

I am facing a problem to save the List values into XML file to specific location.
I am putting the some prototype code for getting the List data which needs to be save in xml format/file.

DataService dbObj;
int main(int argc, char* argv[])
{
	
	if(dbObj.OpenDB() ) // open the MS Access database using DAO
	{
		DisplayMsg(_T("PASS"), _T("OpenDB()") ) ; 			
	}
	else
	{
		DisplayMsg(_T("FAIL"), _T("OpenDB()") ) ; 			
		
	} 
	
	
	CheckValuesByDate(); 
	
	
	if(dbObj.CloseTrendDB()) //Close the MS access database
	{
		DisplayMsg(_T("PASS"), _T("CloseDB()") ) ; 			
	}
	else
	{
		DisplayMsg(_T("FAIL"), _T("CloseDB()") ); 
	}
}
void CheckValuesByDate()
{
	
	list<DataValues> tValueList; 
	list<DataValues>::iterator t; 
	
	CString sqlCondition = _T("select * from table"); 

//Function which will return the all values into tValueList based on sql condition and date duration	
	dbObj.GetTrendValuesByDate(tValueList,sqlCondition, "5/12/2009", "10/23/2012");
	
}



因此,需要将所有



So there is a requirement to save the all

tValueList

值保存到特定位置(用户指定的位置)的XML文件中.

请让我知道是否有任何参考库或任何解决方案来执行此操作.

请让我知道是否有任何澄清.

values into XML file in specific location (location given by user).

Please let me know if there is any reference libraries or any solution to perform this.

Please let me know for any clarification.

推荐答案

看看 ^ ],可能足以解决您的问题.
Take a look at XmlLite[^], it may be enough for your problem.


这篇关于如何将列表(C ++列表)值解析或保存到XML文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆