标签:
封装xml处理类
//排名、团队名称、上级团队、行进天数、行进里程(公里)、万步率、日人均步数、达标率 (已设置时展示)
//上传率、总步数、 日均步数、人均步数、 总积分、日均积分、抵达时间
xmlStr << X_E("datas");
xmlStr<<X_E("datatime")<<X_A("endtime",endTime.c_str())<<X_A("starttime",startTime.c_str())<<X_EE;
xmlStr<<X_E("group_data")
<<X_A("rank","排名")
<<X_A("groupname","团队名称")
<<X_A("praentgroupname","上级团队")
<<X_A("distance","行进里程(单位:公里)")
<<X_A("wanbu_rate","万步率")
<<X_A("day_average_step","日人均步数")
<<X_A("passrule_rate","达标率")
<<X_A("upload_rate","上传率")
<<X_A("totalstepnum","总步数")
<<X_A("perstepnumofday","日均步数")
<<X_A("perstepnumofperson","人均步数")
<<X_A("totalcredit","总积分")
<<X_A("percreditofday","日均积分")
<<X_A("arrive_time","抵达时间");
//根据vecter下有多少数据,进行遍历输出团队详细信息
xmlStr<<X_E("one_group");
for( int i = 0; i < levelOne_vec.size(); i++ )
{
xmlStr << X_E("group")
<<X_A("rank",levelOne_vec[i].rank)
<<X_A("groupname",levelOne_vec[i].groupName.c_str())
<<X_A("praentgroupname",levelOne_vec[i].parentGroup.c_str())
<<X_A("distance",levelOne_vec[i].WalkDistanceStr.c_str())
<<X_A("wanbu_rate",levelOne_vec[i].wanbuRateStr.c_str())
<<X_A("day_average_step",levelOne_vec[i].perNumberOfDay)
<<X_A("passrule_rate",levelOne_vec[i].passRuleRateStr.c_str())
<<X_A("upload_rate",levelOne_vec[i].uploadRateStr.c_str())
<<X_A("totalstepnum",levelOne_vec[i].totalStepNum)
<<X_A("perstepnumofday",levelOne_vec[i].perStepNumOfDay)
<<X_A("perstepnumofperson",levelOne_vec[i].perStepNumOfPerson)
<<X_A("totalcredit",levelOne_vec[i].totalCreditStr.c_str())
<<X_A("percreditofday",levelOne_vec[i].perCreditOfDayStr.c_str())
<<X_A("arrive_time",levelOne_vec[i].timeStr.c_str())
<<X_EE;
}
xmlStr<<X_EE;
标签:
原文地址:http://www.cnblogs.com/xuelei/p/4505712.html