I've found that UNKNOWN is defined in 'Microsoft Visual Studio\VC98\CRT\SRC\ERRMSG.H' and clases with the enum in TinyXML.H.
I have changed the enum to the following:
enum NodeType
{
TIXML_DOCUMENT,
TIXML_ELEMENT,
TIXML_COMMENT,
TIXML_UNKNOWN,
TIXML_TEXT,
TIXML_DECLARATION,
TIXML_TYPECOUNT
};
which is more in keeping with the rest of the code anyway.
Is this the appropriate place to suggest these changes be adopted in to the mainstream code base?
Dave.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
That's a good catch. I don't like to change the API, generally, but to not have a prefix (or namespace) around something like "DOCUMENT" is flat-out wrong. I'm surprised no one has complained before.
I changed it in the (local) code. The change will be in the next version.
lee
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Ack, sorry wrote too quickly. The constants are scoped to TiXmlNode...so that is a bug in ERRMSG.H, not TinyXML. Still, the enum isn't exposed publicly, so it is a safe change.
lee
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I've found that UNKNOWN is defined in 'Microsoft Visual Studio\VC98\CRT\SRC\ERRMSG.H' and clases with the enum in TinyXML.H.
I have changed the enum to the following:
enum NodeType
{
TIXML_DOCUMENT,
TIXML_ELEMENT,
TIXML_COMMENT,
TIXML_UNKNOWN,
TIXML_TEXT,
TIXML_DECLARATION,
TIXML_TYPECOUNT
};
which is more in keeping with the rest of the code anyway.
Is this the appropriate place to suggest these changes be adopted in to the mainstream code base?
Dave.
That's a good catch. I don't like to change the API, generally, but to not have a prefix (or namespace) around something like "DOCUMENT" is flat-out wrong. I'm surprised no one has complained before.
I changed it in the (local) code. The change will be in the next version.
lee
Ack, sorry wrote too quickly. The constants are scoped to TiXmlNode...so that is a bug in ERRMSG.H, not TinyXML. Still, the enum isn't exposed publicly, so it is a safe change.
lee