The markup of C + + library

Source: Internet
Author: User

Markup very good a C + + library, directly download the source code from the official website to add the relevant documents to the project compilation. Examples are as follows:

XML file:

<?xml version= "1.0" encoding= "Utf-8"?>
<orderStaDic>

<orderSta>
<ORDERSTACODE>04</ORDERSTACODE>
<ORDERSTANAME>??? ~??? Л</orderstaname>
</orderSta>

<orderSta>
<ORDERSTACODE>03</ORDERSTACODE>
<ORDERSTANAME>??? ~???? </ORDERSTANAME>
</orderSta>
</orderStaDic>

C + + parsing code:

void Loaddicxml ()
{
CMarkup XML;
String str= "Goodsdic.xml";
BOOL Xx=xml. Load (str);
Xml. Resetmainpos ();
int id=0;

while (XML. Findchildelem ("Ordersta"))
{
Goodsdics M_GD;
Xml. Intoelem ();


Xml. Findchildelem ("Orderstacode");
String codestr= XML. Getchilddata ();
strcpy (M_gd.statecode,codestr.c_str ());

Xml. Findchildelem ("Orderstaname");
String namestr= XML. Getchilddata ();
strcpy (M_gd.statename,namestr.c_str ());

QString STRTMP1 (M_gd.statecode);
QString STRTMP2 (m_gd.statename);

Qmessagebox::warning (This, "666666", tr (m_gd.statecode) +tr (m_gd.statename));
Map_psstatesno.insert (STRTMP1,M_GD);


Map_psstatesmsg.insert (STRTMP2,M_GD);
Xml. Outofelem ();
}
}

This I also loaded into QT use, feel very convenient to use.


The markup of C + + library

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.