≡
Products
▼
Support
▼
Company
▼
Forum
Ambiera Forum
Discussions, Help and Support.
Create a new account
,
Search
, or Login:
Create reply in
some bugs and correction
Posted by:
(you are not logged in)
Enter the missing letter in: "Inte?national"
(you are not logged in)
Text:
[quote][b]Menuki[/b] wrote: Hello, Being a long time user of irrXML, I post some correction I made. Here the source code of each method I corrected. All are in CXMLReaderImpl.h Line 74 : I made parseCurrentNode() returning a boolean to correctly handle the end of file. So now read() look like: [code] virtual bool read() { // if not end reached, parse the node if (P && (unsigned int)(P - TextBegin) < TextSize - 1 && *P != 0) { return parseCurrentNode(); } _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX; return false; } [/code] Line 93 : It is not a big problem but this line cause a unsigned to signed conversion warning with VS2010 so: [code] virtual int getAttributeCount() const { return (int)Attributes.size(); } [/code] Line 213 : parseCurrentNode() now returns a boolean. It returns false when it reach the end of file. [code] bool parseCurrentNode() { char_type* start = P; // more forward until '<' found while(*P != L'<' && *P) ++P; if (!*P) return false; if (P - start > 0) { // we found some text, store it if (setText(start, P)) return true; } ++P; // based on current token, parse and report next element switch(*P) { case L'/': parseClosingXMLElement(); break; case L'?': ignoreDefinition(); break; case L'!': if (!parseCDATA()) parseComment(); break; default: parseOpeningXMLElement(); break; } return true; } [/code] Line 424: In bad formated file, if closing bracket is missing, parseClosingXMLElement() crashed because there is no "end of file" check in this line. So the while condition : [code]while(*P != L'>')[/code]become[code]while(P && (unsigned int)(P - TextBegin) < TextSize - 1 && *P != 0 && *P != L'>')[/code] Line 542: Replacing special characters do not always copy all trailing characters because of the '<' comperand which must be a '<=' comperand. The comparaison becomes : [code]if (oldPos <= origstr.size()-1)[/code] Line 614: UTF8 file are not detected with VS2010. data8[] element are signed extented to int (0xEF becomes 0xFFFFFFEF) while UTF8[] element are non signed extended to int (0xEF becomes 0xEF). So the condition is never true. We have to tell the compiler to do a non signed extension of data8[] elements.[code]if (size >= 3 && data8[0] == UTF8[0] && data8[1] == UTF8[1] && data8[2] == UTF8[2])[/code]become[code]if (size >= 3 && reinterpret_cast<unsigned char *>(data8)[0] == UTF8[0] && reinterpret_cast<unsigned char *>(data8)[1] == UTF8[1] && reinterpret_cast<unsigned char *>(data8)[2] == UTF8[2]) [/code][/quote]
Possible Codes
Feature
Code
Link
[url] www.example.com [/url]
Bold
[b]bold text[/b]
Image
[img]http://www.example.com/image.jpg[/img]
Quote
[quote]quoted text[/quote]
Code
[code]source code[/code]
Emoticons
Copyright© Ambiera e.U. all rights reserved.
Privacy Policy | Terms and Conditions | Imprint | Contact