/**
****************************************************************************
* <P> XML.c - implementation file for basic XML parser written in ANSI C++
* for portability. It works by using recursion and a node tree for breaking
* down the elements of an XML document. </P>
*
* @version V2.14
* @author Frank Vanden Berghen
*
* NOTE:
*
* If you add "#define STRICT_PARSING", on the first line of this file
* the parser will see the following XML-stream:
* <a><b>some text</b><b>other text </a>
* as an error. Otherwise, this tring will be equivalent to:
* <a><b>some text</b><b>other text</b></a>
*
* NOTE:
*
* If you add "#define APPROXIMATE_PARSING" on the first line of this file
* the parser will see the following XML-stream:
* <data name="n1">
* <data name="n2">
* <data name="n3" />
* as equivalent to the following XML-stream:
* <data name="n1" />
* <data name="n2" />
* <data name="n3" />
* This can be useful for badly-formed XML-streams but prevent the use
* of the following XML-stream (problem is: tags at contiguous levels
* have the same names):
* <data name="n1">
* <data name="n2">
* <data name="n3" />
* </data>
* </data>
*
* NOTE:
*
* If you add "#define _XMLPARSER_NO_MESSAGEBOX_" on the first line of this file
* the "openFileHelper" function will always display error messages inside the
* console instead of inside a message-box-window. Message-box-windows are
* available on windows only.
*
* BSD license:
* Copyright (c) 2002, Frank Vanden Berghen
* All rights reserved.
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the Frank Vanden Berghen nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND ANY
* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE REGENTS AND CONTRIBUTORS BE LIABLE FOR ANY
* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
****************************************************************************
*/
#ifdef WIN32
//#ifdef _DEBUG
//#define _CRTDBG_MAP_ALLOC
//#include <crtdbg.h>
//#endif
#define WIN32_LEAN_AND_MEAN
#ifndef _CRT_SECURE_NO_DEPRECATE
#define _CRT_SECURE_NO_DEPRECATE
#endif
#include <Windows.h> // to have IsTextUnicode, MultiByteToWideChar, WideCharToMultiByte to handle unicode files
// to have "MessageBoxA" to display error messages for openFilHelper
#endif
#include <memory.h>
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include "xmlParser.h"
inline int mmin( const int t1, const int t2 ) { return t1 < t2 ? t1 : t2; }
// You can modify the initialization of the variable "XMLClearTags" below
// to change the clearTags that are currently recognized by the library.
ALLXMLClearTag XMLClearTags[] =
{
{ _T("<![CDATA["),9, _T("]]>") },
{ _T("<PRE>") ,5, _T("</PRE>") },
{ _T("<Script>") ,8, _T("</Script>")},
{ _T("<!--") ,4, _T("-->") },
{ _T("<!DOCTYPE"),9, _T(">") },
{ NULL ,0, NULL }
};
// You can modify the initialization of the variable "XMLEntities" below
// to change the character entities that are currently recognized by the library.
// Additionally, the syntaxes " " and " " are recognized.
typedef struct { XMLCSTR s; int l; XMLCHAR c;} XMLCharacterEntity;
static XMLCharacterEntity XMLEntities[] =
{
{ _T("&" ), 5, _T('&' )},
{ _T("<" ), 4, _T('<' )},
{ _T(">" ), 4, _T('>' )},
{ _T("""), 6, _T('\"')},
{ _T("'"), 6, _T('\'')},
{ NULL , 0, '\0' }
};
// When rendering the XMLNode to a string (using the "createXMLString" function),
// you can ask for a beautiful formatting. This formatting is using the
// following indentation character:
#define INDENTCHAR _T('\t')
// The following function parses the XML errors into a user friendly string.
// You can edit this to change the output language of the library to something else.
XMLCSTR XMLNode::getError(XMLError xerror)
{
switch (xerror)
{
case eXMLErrorNone: return _T("No error");
case eXMLErrorMissingEndTag: return _T("Warning: Unmatched end tag");
case eXMLErrorEmpty: return _T("Error: No XML data");
case eXMLErrorFirstNotStartTag: return _T("Error: First token not start tag");
case eXMLErrorMissingTagName: return _T("Error: Missing start tag name");
case eXMLErrorMissingEndTagName: return _T("Error: Missing end tag name");
case eXMLErrorNoMatchingQuote: return _T("Error: Unmatched quote");
case eXMLErrorUnmatchedEndTag: return _T("Error: Unmatched end tag");
case eXMLErrorUnmatchedEndClearTag: return _T("Error: Unmatched clear tag end");
case eXMLErrorUnexpectedToken: return _T("Error: Unexpected token found");
case eXMLErrorInvalidTag: return _T("Error: Invalid tag found");
case eXMLErrorNoElements: return _T("Error: No elements found");
case eXMLErrorFileNotFound: return _T("Error: File not found");
case eXMLErrorFirstTagNotFound: return _T("Error: First Tag not found");
case eXMLErrorUnknownEscapeSequence: return _T("Error: Unknown character entity");
case eXMLErrorCharConversionError: return _T("Error: unable to convert between UNICODE and MultiByte chars");
case eXMLErrorCannotOpenWriteFile: return _T("Error: unable to open file for writing");
case eXMLErrorCannotWriteFile: return _T("Error: cannot write into file");
case eXMLErrorBase64DataSizeIsNotMultipleOf4: return _T("Warning: Base64-string length is not a multiple of 4");
case eXMLErrorBase64DecodeTruncatedData: return _T("Warning: Base64-string is truncated");
case eXMLErrorBase64DecodeIllegalCharacter: return _T("Error: Base64-string contains an illegal character");
case eXMLErrorBase64DecodeBufferTooSmall: return _T("Error: Base64 decode output buffer is too small");
};
return _T("Unknown");
}
#ifndef _XMLUNICODE
// If "strictUTF8Parsing=0" then we assume that all characters have the same length of 1 byte.
// If "strictUTF8Parsing=1" then the characters have different lengths (from 1 byte to 4 bytes).
// This table is used as lookup-table to know the length of a character (in byte) based on the
// content of the first byte of the character.
// (note: if you modify this, you must always have XML_utf8ByteTable[0]=0 ).
static const char XML_utf8ByteTable[256] =
{
// 0 1 2 3 4 5 6 7 8 9 a b c d e f
0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x00
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x10
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x20
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,// 0x30
1,1,1,1,1,
没有合适的资源?快使用搜索试试~ 我知道了~
iOS游戏应用源代码——tristanstcyr-MacFungus-2.0-8f1f7e3.zip
共110个文件
h:25个
tif:16个
m:14个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 186 浏览量
2023-07-05
23:24:32
上传
评论
收藏 405KB ZIP 举报
温馨提示
iOS游戏应用源代码——tristanstcyr-MacFungus-2.0-8f1f7e3.zip
资源推荐
资源详情
资源评论
收起资源包目录
iOS游戏应用源代码——tristanstcyr-MacFungus-2.0-8f1f7e3.zip (110个子文件)
bite.aiff 16KB
xmlParser.cpp 88KB
MFGame.cpp 22KB
MFGrid.cpp 14KB
.gitignore 20B
xmlParser.h 25KB
NSThemeFrame.h 8KB
AsyncSocket.h 8KB
NSTitledFrame.h 6KB
GameController.h 4KB
MFGame.h 4KB
NSFrameView.h 3KB
MFGridView.h 3KB
NSDrawerWindow.h 2KB
MFGrid.h 2KB
NSDrawerFrame.h 2KB
CTGradient.h 2KB
TSFunkyTableView.h 1KB
ChatController.h 714B
NSView+AMViewAnimation.h 610B
TSTimedProgressIndicator.h 581B
AppController.h 495B
MFPlayerCell.h 439B
MFPlayersTable.h 317B
MFGlowingButton.h 283B
LocalGameController.h 263B
AnimatedSplitView.h 237B
MFDrawer.h 197B
MFChatTextField.h 190B
MultiplayerGameController.h 162B
icon.icns 38KB
LICENSE 1KB
AsyncSocket.m 44KB
CTGradient.m 32KB
TSFunkyTableView.m 11KB
MFDrawer.m 7KB
ChatController.m 6KB
MFPlayerCell.m 5KB
TSTimedProgressIndicator.m 5KB
MFPlayersTable.m 5KB
MFChatTextField.m 3KB
AnimatedSplitView.m 3KB
NSView+AMViewAnimation.m 2KB
MFGlowingButton.m 2KB
AppController.m 312B
main.m 250B
GameController.mm 34KB
MFGridView.mm 23KB
LocalGameController.mm 6KB
AppController.mm 602B
MultiplayerGameController.mm 450B
bell.mp3 67KB
drums.mp3 40KB
boing.mp3 11KB
phaser.mp3 4KB
designable.nib 166KB
keyedobjects.nib 32KB
keyedobjects.nib 12KB
keyedobjects.nib 12KB
keyedobjects.nib 10KB
keyedobjects.nib 10KB
info.nib 2KB
info.nib 2KB
classes.nib 899B
classes.nib 899B
classes.nib 777B
classes.nib 777B
info.nib 567B
info.nib 567B
project.pbxproj 41KB
default.pbxuser 34KB
MacFungus2.0_Prefix.pch 155B
Info.plist 850B
top_middle.png 762B
shapesbg.png 617B
circlehighlight.png 557B
tiny-reload.png 445B
top_left.png 371B
top_right.png 363B
bottom_middle.png 324B
bottom_right.png 296B
bottom_left.png 280B
divider.png 187B
metal_column_header.png 164B
README 384B
InfoPlist.strings 238B
Localizable.strings 104B
chatdrawerout.tif 153KB
chatdrawerin.tif 153KB
settingsBanner.tif 54KB
gameTrackerBannerText.tif 49KB
skipN.tif 35KB
skipP.tif 35KB
biteN.tif 35KB
biteP.tif 34KB
blueMinusButton.tif 30KB
bluePlusButton.tif 29KB
aquaBG.tif 26KB
lcdmiddle.tif 26KB
lcdleftcap.tif 26KB
共 110 条
- 1
- 2
资源评论
快乐无限出发
- 粉丝: 1137
- 资源: 7276
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功