/*
www.sourceforge.net/projects/tinyxml
Original code (2.0 and earlier )copyright (c) 2000-2006 Lee Thomason (www.grinninglizard.com)
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any
damages arising from the use of this software.
Permission is granted to anyone to use this software for any
purpose, including commercial applications, and to alter it and
redistribute it freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must
not claim that you wrote the original software. If you use this
software in a product, an acknowledgment in the product documentation
would be appreciated but is not required.
2. Altered source versions must be plainly marked as such, and
must not be misrepresented as being the original software.
3. This notice may not be removed or altered from any source
distribution.
*/
#ifndef TINYXML_INCLUDED
#define TINYXML_INCLUDED
#ifdef _MSC_VER
#pragma warning( push )
#pragma warning( disable : 4530 )
#pragma warning( disable : 4786 )
#endif
#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
// Help out windows:
#if defined( _DEBUG ) && !defined( DEBUG )
#define DEBUG
#endif
#ifdef TIXML_USE_STL
#include <string>
#include <iostream>
#include <sstream>
#define TIXML_STRING std::string
#else
#include "tinystr.h"
#define TIXML_STRING TiXmlString
#endif
// Deprecated library function hell. Compilers want to use the
// new safe versions. This probably doesn't fully address the problem,
// but it gets closer. There are too many compilers for me to fully
// test. If you get compilation troubles, undefine TIXML_SAFE
#define TIXML_SAFE
#ifdef TIXML_SAFE
#if defined(_MSC_VER) && (_MSC_VER >= 1400 )
// Microsoft visual studio, version 2005 and higher.
#define TIXML_SNPRINTF _snprintf_s
#define TIXML_SNSCANF _snscanf_s
#define TIXML_SSCANF sscanf_s
#elif defined(_MSC_VER) && (_MSC_VER >= 1200 )
// Microsoft visual studio, version 6 and higher.
//#pragma message( "Using _sn* functions." )
#define TIXML_SNPRINTF _snprintf
#define TIXML_SNSCANF _snscanf
#define TIXML_SSCANF sscanf
#elif defined(__GNUC__) && (__GNUC__ >= 3 )
// GCC version 3 and higher.s
//#warning( "Using sn* functions." )
#define TIXML_SNPRINTF snprintf
#define TIXML_SNSCANF snscanf
#define TIXML_SSCANF sscanf
#else
#define TIXML_SSCANF sscanf
#endif
#endif
class TiXmlDocument;
class TiXmlElement;
class TiXmlComment;
class TiXmlUnknown;
class TiXmlAttribute;
class TiXmlText;
class TiXmlDeclaration;
class TiXmlParsingData;
const int TIXML_MAJOR_VERSION = 2;
const int TIXML_MINOR_VERSION = 5;
const int TIXML_PATCH_VERSION = 3;
/* Internal structure for tracking location of items
in the XML file.
*/
struct TiXmlCursor
{
TiXmlCursor() { Clear(); }
void Clear() { row = col = -1; }
int row; // 0 based.
int col; // 0 based.
};
/**
If you call the Accept() method, it requires being passed a TiXmlVisitor
class to handle callbacks. For nodes that contain other nodes (Document, Element)
you will get called with a VisitEnter/VisitExit pair. Nodes that are always leaves
are simple called with Visit().
If you return 'true' from a Visit method, recursive parsing will continue. If you return
false, <b>no children of this node or its sibilings</b> will be Visited.
All flavors of Visit methods have a default implementation that returns 'true' (continue
visiting). You need to only override methods that are interesting to you.
Generally Accept() is called on the TiXmlDocument, although all nodes suppert Visiting.
You should never change the document from a callback.
@sa TiXmlNode::Accept()
*/
class TiXmlVisitor
{
public:
virtual ~TiXmlVisitor() {}
/// Visit a document.
virtual bool VisitEnter( const TiXmlDocument& /*doc*/ ) { return true; }
/// Visit a document.
virtual bool VisitExit( const TiXmlDocument& /*doc*/ ) { return true; }
/// Visit an element.
virtual bool VisitEnter( const TiXmlElement& /*element*/, const TiXmlAttribute* /*firstAttribute*/ ) { return true; }
/// Visit an element.
virtual bool VisitExit( const TiXmlElement& /*element*/ ) { return true; }
/// Visit a declaration
virtual bool Visit( const TiXmlDeclaration& /*declaration*/ ) { return true; }
/// Visit a text node
virtual bool Visit( const TiXmlText& /*text*/ ) { return true; }
/// Visit a comment node
virtual bool Visit( const TiXmlComment& /*comment*/ ) { return true; }
/// Visit an unknow node
virtual bool Visit( const TiXmlUnknown& /*unknown*/ ) { return true; }
};
// Only used by Attribute::Query functions
enum
{
TIXML_SUCCESS,
TIXML_NO_ATTRIBUTE,
TIXML_WRONG_TYPE
};
// Used by the parsing routines.
enum TiXmlEncoding
{
TIXML_ENCODING_UNKNOWN,
TIXML_ENCODING_UTF8,
TIXML_ENCODING_LEGACY
};
const TiXmlEncoding TIXML_DEFAULT_ENCODING = TIXML_ENCODING_UNKNOWN;
/** TiXmlBase is a base class for every class in TinyXml.
It does little except to establish that TinyXml classes
can be printed and provide some utility functions.
In XML, the document and elements can contain
other elements and other types of nodes.
@verbatim
A Document can contain: Element (container or leaf)
Comment (leaf)
Unknown (leaf)
Declaration( leaf )
An Element can contain: Element (container or leaf)
Text (leaf)
Attributes (not on tree)
Comment (leaf)
Unknown (leaf)
A Decleration contains: Attributes (not on tree)
@endverbatim
*/
class TiXmlBase
{
friend class TiXmlNode;
friend class TiXmlElement;
friend class TiXmlDocument;
public:
TiXmlBase() : userData(0) {}
virtual ~TiXmlBase() {}
/** All TinyXml classes can print themselves to a filestream
or the string class (TiXmlString in non-STL mode, std::string
in STL mode.) Either or both cfile and str can be null.
This is a formatted print, and will insert
tabs and newlines.
(For an unformatted stream, use the << operator.)
*/
virtual void Print( FILE* cfile, int depth ) const = 0;
/** The world does not agree on whether white space should be kept or
not. In order to make everyone happy, these global, static functions
are provided to set whether or not TinyXml will condense all white space
into a single space or not. The default is to condense. Note changing this
value is not thread safe.
*/
static void SetCondenseWhiteSpace( bool condense ) { condenseWhiteSpace = condense; }
/// Return the current white space setting.
static bool IsWhiteSpaceCondensed() { return condenseWhiteSpace; }
/** Return the position, in the original source file, of this node or attribute.
The row and column are 1-based. (That is the first row and first column is
1,1). If the returns values are 0 or less, then the parser does not have
a row and column value.
Generally, the row and column value will be set when the TiXmlDocument::Load(),
TiXmlDocument::LoadFile(), or any TiXmlNode::Parse() is called. It will NOT be set
when the DOM was created from operator>>.
The values reflect the initial load. Once the DOM is modified programmatically
(by adding or changing nodes and attributes) the new values will NOT update to
reflect changes in the document.
There is a minor performance cost to computing the row and column. Computation
can be disabled if TiXmlDocument::SetTabSize() is called with 0 as the value.
@sa TiXmlDocument::SetTabSize()
*/
int Row() const { return location.row + 1; }
int Column() const { return location.col + 1; } ///< See Row()
void SetUserData( void* user ) { userData = user; } ///< Set a pointer to arbitrary user data.
void* GetUserData() { return userData; } ///< Get a pointer to arbitrary user data.
const void* GetUserData() const { return userData; } ///< Get a pointer to arbitrary user data.
// Table that returs, for a given lead byte,
没有合适的资源?快使用搜索试试~ 我知道了~
冒险岛c++服务端源码
共10332个文件
xml:10188个
h:61个
cpp:61个
需积分: 6 46 下载量 152 浏览量
2017-07-27
17:10:20
上传
评论 3
收藏 6.82MB ZIP 举报
温馨提示
冒险岛 c++ 服务端源码,是学习网络游戏编程的好资料,有完整的数据结构。
资源推荐
资源详情
资源评论
收起资源包目录
冒险岛c++服务端源码 (10332个子文件)
MapleStoryServer.cbp 4KB
Decoder.cbp 1KB
tinyxmlparser.cpp 36KB
tinyxml.cpp 36KB
Salon.cpp 26KB
Initializing.cpp 26KB
Skills.cpp 17KB
Inventory.cpp 16KB
MapleIsland.cpp 14KB
AESEncryption.cpp 14KB
Player.cpp 12KB
MySQLM.cpp 10KB
Mobs.cpp 10KB
Plastic Surgery.cpp 10KB
Drops.cpp 10KB
Players.cpp 10KB
PlayerPacket.cpp 9KB
Quests.cpp 8KB
Characters.cpp 7KB
LoginPacket.cpp 7KB
InventoryPacket.cpp 7KB
NPCs.cpp 6KB
MobsPacket.cpp 6KB
Levels.cpp 5KB
Maps.cpp 4KB
MapPacket.cpp 4KB
MapleEncryption.cpp 4KB
Login.cpp 4KB
DropsPacket.cpp 4KB
SkinCare.cpp 4KB
PacketHandler.cpp 4KB
SkillsPacket.cpp 4KB
PlayersPacket.cpp 4KB
PacketCreator.cpp 3KB
QuestsPacket.cpp 3KB
GameMasters.cpp 3KB
Timer.cpp 3KB
Connector.cpp 3KB
tinystr.cpp 3KB
Selector.cpp 2KB
LevelsPacket.cpp 2KB
ChannelsPlayers.cpp 2KB
Acceptor.cpp 2KB
Shops.cpp 2KB
MasterServer.cpp 2KB
MapleStoryServer.cpp 2KB
ChannelsPacket.cpp 2KB
tinyxmlerror.cpp 2KB
Channels.cpp 2KB
ServerPacket.cpp 2KB
PlayerLogin.cpp 2KB
Server.cpp 2KB
Decoder.cpp 2KB
MasterServerPacket.cpp 2KB
Worlds.cpp 1KB
NPCPacket.cpp 1KB
Channel.cpp 1KB
TimerTest.cpp 1KB
MasterDecoder.cpp 1KB
PlayerInventory.cpp 854B
Connection.cpp 0B
Event.cpp 0B
PvPSystem.cpp 0B
libmysql.def 3KB
libmysql.dll 2.5MB
MapleStoryServer.vcxproj.filters 12KB
Connection.vcxproj.filters 2KB
Decoder.vcxproj.filters 2KB
.gitattributes 483B
.gitignore 3KB
tinyxml.h 63KB
mysql.h 33KB
mysql_com.h 17KB
mysqld_error.h 16KB
mysqld_ername.h 16KB
tinystr.h 9KB
NPCsScripts.h 8KB
Skills.h 5KB
Drops.h 5KB
Player.h 5KB
NPCs.h 3KB
Mobs.h 3KB
PlayerInventory.h 3KB
Quests.h 3KB
PacketCreator.h 2KB
PlayerLogin.h 2KB
mysql_time.h 2KB
Inventory.h 2KB
MySQLM.h 2KB
InventoryPacket.h 2KB
my_alloc.h 2KB
LoginPacket.h 2KB
PacketHandler.h 2KB
Decoder.h 2KB
MobsPacket.h 2KB
Characters.h 2KB
Players.h 2KB
Maps.h 1KB
DropsPacket.h 1KB
my_list.h 1KB
共 10332 条
- 1
- 2
- 3
- 4
- 5
- 6
- 104
资源评论
wyxdyx111
- 粉丝: 2
- 资源: 29
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功