Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

TinyXML(C++ XML½âÎö¿â)

дһ¸öXMLÎļþ TinyXML ÊÇÒ»¸öminiµÄC++ XML½âÎö¿â,ËüÊÇ·ÇÑéÖ¤µÄ,Ëü¿ÉÒÔºÜÈÝÒ׵ļ¯³Éµ½ÆäËûµÄ³ÌÐòÖÐ.Ëü½âÎöÒ»·ÝXML doc,ÒÔ´Ë´´½¨Ò»¸ö¿ÉÒÔ±»¶Á¡¢Ð´£¬±£´æµÄDOM.ËüÖ÷ÒªµÄÀà²ã´Î¼Ü¹¹£¬º¯ÊýÔ­ÐÎÏêϸ˵Ã÷²Î¿´: http://www.grinninglizard.com/tinyxml/index.html
// ÒÔÏÂÒÔ¼òµ¥µÄ³ÌÐòTinyXMLTestΪÀý TinyXMLÖÐ×î¸ù±¾µÄ¾ÍÊÇDocument£¬ËùÒÔÎÞÂÛÊÇÐèҪдһ¸öXMLÎļþ£¬»¹ÊÇÒª¶Á£¬¶¼±ØÐë´ÓÒ»¸öDocument¿ªÊ¼,¾ÍÊÇ(1)µÄ¶¯×÷,ÔÚ´ËûÓиø¹¹Ô캯ÊýÒ»¸ö²ÎÊýÊÇÒòΪÎÒÃǵÄÄ¿µÄÊÇΪÁËд³öÒ»¸öXMLÎļþ£¬ÎļþµÄÃû×Ö¾ÍÊÇ´«¸øTiXmlDocumentµÄ²ÎÊý¡£ÉùÃ÷£¬Îĵµ£¬×¢ÊÍ£¬Îı¾,ÔªËØ£¬²»Ã÷ÀàÐͶ¼ÊÇTinyXmlNodeµÄ×ÓÀ࣬¶¼ÊÇÒ»¸öNode,TinyXmlNodeÊÇÒ»¸öºÜ¸´ÔӵĶ«Î÷£¬ËüÈçÉÏËùʾ:
#include
#include "tinyxml.h"
using namespace std;
int main(int argc, char** argv)
{
// (1) create a XML document
TiXmlDocument *myDoc = new TiXmlDocument();
DocumentÀàÐ͵Ľڵ㽨Á¢ºÃÒԺ󣬾ÍÐèÒª¸ø¸Ã£Ä£Ï£ÍÊ÷½á¹¹Ò»¸ö¸ù,¼´ÏÂÃæµÄ(2),(3),(5),ÓÉÓÚTinyXmlÊÇ·ÇÑéÖ¤µÄ£¬ËùÒÔÀíÂÛÉÏËûÊÇ¿ÉÒÔÓÐÁ½¸öDocumentµÄ£¬£¨ÔÚÄÚ²¿Í¨¹ý¶ÔÀàÐ͵ÄÅжÏÀ´±ÜÃâÕâÒ»Çé¿öµÄ·¢Éú£©,ÓÉÓÚ¸ùÊÇÒ»¸öÔªËØ£¬¶øÔªËر¾ÖÊÉϾÍÊÇÒ»¸öÈÝÆ÷£¬Ëû¿ÉÒÔÓÐ×ÓÔªËØ£¬Îı¾µÈ£¬ÓÉÓÚÊôÐÔ¿ÉÒÔÓжà¸ö£¬ËùÒÔÔÚÄÚ²¿ËüÓÐÒ»¸öTinyXmlAttrbuiteSetµÄ³ÉÔ±£¬ÓÃÒÔ´¢´æÖ®£¬¶øÔÚTinyXmlAttrbuiteSetÖÐËù´æµÄAttrbuitesÊÇͨ¹ý´ø”ÉÚ±ø”µÄÁ´±íÀ´ÊµÏÖ.ÔÚÿ´ÎÁ´½Óʱ£¬¶¼ÊÇ·ÅÖÃÔÚ×îºóÒ»¸öλÖÃ
//(2) create the Root and connect it
TiXmlElement *RootElement = new TiXmlElement("ÈËÔ±×é");
myDoc->LinkEndChild(RootElement);
//(3 )create a person and connect it
TiXmlElement *PersonElement = new TiXmlElement("ÈËÔ±");
RootElement ->LinkEndChild(PersonElement);
Èç(4)Ëùʾ£¬Èç¹ûÒ»¸öÔªËØÓÐÊôÐÔÐèÒªÉèÖã¬Í¨¹ýµ÷ÓÃSetAttribute()·½·¨,¿ÉÒÔʵÏÖÄ¿±ê,ÔÚÉèÖÃʱ£¬»áÔÚElementµÄÄÚ²¿µÄÁ´±íÉÏËÑË÷£¬Èç¹ûÒѾ­ÓÐÏàÓ¦µÄÊôÐÔÃû£¬ÄÇôÊÓ֮Ϊ¸Äд,Èç¹ûûÓÐÔòÌí¼Ó.
//(4) set the attribute fo Person
PersonElement ->SetAttribute("ID", "1");
//(5) create Elementy name && age and connect them
TiXmlElement* NameElement = new TiXmlElement("ÐÕÃû");
TiXmlElement* AgeElement = new TiXmlElement("ÄêÁä");
PersonElement ->LinkEndChild(NameElement);
PersonElement ->


Ïà¹ØÎĵµ£º

XMLÈëÃŵij£¼ûÎÊÌâ(Èý)

ÈçºÎ¼ÓÔØÓÐÍâ¹úºÍÌØÊâ×Ö·ûµÄÎĵµ£¿
¡¡¡¡Îĵµ¿ÉÒÔ°üº¬Íâ¹ú×Ö·û£¬ÀýÈ磺
 ¡¡¡¡foreign characters (úóí?) 
¡¡¡¡ÀýÈç íá µÄÍâ¹ú×Ö·û±ØÐëÔÚÇ°Ãæ¼ÓÉÏ escape ÐòÁС£Íâ¹ú×Ö·û¿ÉÒÔÊÇ UTF-8 ±àÂë»òÓò»Í¬±àÂëÖ¸¶¨£¬ÈçÏÂËùʾ£º
 ¡¡¡¡foreign characters (íá) 
¡¡¡ ......

(ת)ʹÓÃC/C++À©Õ¹Python

ʹÓÃC/C++À©Õ¹Python
·­Òë:
gashero
Èç¹ûÄã»áÓÃC£¬ÊµÏÖPythonǶÈëÄ£¿éºÜ¼òµ¥¡£ÀûÓÃÀ©Õ¹Ä£¿é¿É×öºÜ¶àPython²»·½±ã×öµÄÊÂÇ飬ËûÃÇ¿ÉÒÔÖ±½Óµ÷ÓÃC¿âºÍϵͳµ÷Óá£
ΪÁËÖ§³ÖÀ©Õ¹£¬Python API¶¨ÒåÁËһϵÁк¯Êý¡¢ºêºÍ±äÁ¿£¬ÌṩÁ˶ÔPythonÔËÐÐʱϵͳµÄ·ÃÎÊÖ§³Ö¡£PythonµÄC APIÓÉCÔ´Âë×é³É£¬²¢°üº¬ “Python.h” Í·Îļ ......

ruby c++

While looking for information on the subject, I looked into the ONLamp article Extending Ruby with C by Garrett Rooney, the Extending Ruby chapter in the Pickaxe, README.EXT (located at /usr/share/doc/ruby1.8-dev/README.EXT.gz on my Ubuntu system) and got some help from Kjetil.
The resulting file c ......

C++½âÎöXML

ÓÃmingw32-makeÇ°ÐÞ¸ÄÒ»ÏÂmakefileÎļþ,¸ÄΪÈçÏÂ
# DEBUG can be set to YES to include debugging info, or NO otherwise(²»ÊÇDEBUG)
DEBUG          := NO
# PROFILE can be set to YES to include profiling info, or NO otherwise
PROFILE    & ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ