Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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 ->


Ïà¹ØÎĵµ£º

º½¿Õ¹«Ë¾¹ÜÀíϵͳ(VC++ ÓëSQL 2005)

ϵͳ»·¾³£ºWindows 7
Èí¼þ»·¾³£ºVisual C++ 2008 SP1 +SQL Server 2005
±¾´ÎÄ¿µÄ£º±àдһ¸öº½¿Õ¹ÜÀíϵͳ
      ÕâÊÇÊý¾Ý¿â¿Î³ÌÉè¼ÆµÄ³É¹û£¬ËäÈ»³É¼¨²»¼Ñ£¬µ«ÊÇ×÷ΪÎÒÓÃVC++ ÒÔÀ´±àдµÄ×î´ó³ÌÐò»¹ÊÇ´«µ½ÍøÉÏ£¬ÒÔ¹©²Î¿¼¡£ÓÃVC++ ×öÊý¾Ý¿âÉè¼Æ²¢²»ÈÝÒ×£¬µ«Ò²²»ÊDz»¿ÉÄÜ¡£ÒÔÏÂÊÇÎҵijÌÐò½çÃ棬ºóÃæ ......

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

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

cÓëc++µÄstaticº¯Êý


cÓëc++ staticº¯ÊýµÄÇø±ð
±¾ÎÄת×Ô£ºhttp://blog.csdn.net/lipps/archive/2007/05/18/1615419.aspx
static¹Ø¼ü×ÖÊÇC, C++Öж¼´æÔڵĹؼü×Ö, ËüÖ÷ÒªÓÐÈýÖÖʹÓ÷½Ê½, ÆäÖÐÇ°Á½ÖÖÖ»Ö¸ÔÚCÓïÑÔÖÐʹÓÃ, µÚÈýÖÖÔÚC++ÖÐʹÓÃ(C,C++ÖоßÌåϸ΢²Ù×÷²»¾¡Ïàͬ, ±¾ÎÄÒÔC++Ϊ׼).
(1)¾Ö²¿¾²Ì¬±äÁ¿
(2)Íⲿ¾²Ì¬±ä ......

LinuxÏÂC++ʵÏÖPHPÀ©Õ¹Öм¶Ó¦Óã¨Ò»£©


´ËƪÎÄÕÂ×¼±¸·Ö2¸ö²¿·ÖÀ´½²Êö£º
    µÚÒ»²¿·ÖÖ÷ÒªÏêϸ½²ÊöÒ»ÏÂÔõô¹¹½¨Ò»¸öÍê³ÉµÄC++Ó¦ÓÃÀ©Õ¹Ä£¿é£»
   
µÚ¶þ²¿·ÖÖ÷Òª½²ÊöÔÚPHP¼°Zend¿ò¼ÜÏÂÔõôʹÓÃZend APIºÍC++ÓïÑÔÀ´ÊµÏÖ×Ô¼ºËùÒªµÄ¹¦ÄÜÒÔ¼°ÏîÄ¿µÄ¿ª·¢£»
    ´ËƪÎÄÕÂËùÔËÓõĻ·¾³ÔÚLinux
2.4.21-4.ELsmp(Red Ha ......

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 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ