In lib/web/xml2:

cenum xmlParserOption = 
    XML_PARSE_RECOVER,// = 1,  : recover on errors
    XML_PARSE_NOENT,// = 2,  : substitute entities
    XML_PARSE_DTDLOAD,// = 4,  : load the external subset
    XML_PARSE_DTDATTR,// = 8.  : default DTD attributes
    XML_PARSE_DTDVALID,// = 16,  : validate with the DTD
    XML_PARSE_NOERROR,// = 32 : suppress error reports
    XML_PARSE_NOWARNING,// = 64 : suppress warning reports
    XML_PARSE_PEDANTIC,// = 128 : pedantic error reporting
    XML_PARSE_NOBLANKS,// = 256 : remove blank nodes
    XML_PARSE_SAX1,// = 512 : use the SAX1 interface internally
    XML_PARSE_XINCLUDE,// = 1024 : Implement XInclude substitition
    XML_PARSE_NONET,// = 2048 : Forbid network access
    XML_PARSE_NODICT,// = 4096 : Do not reuse the context dictionnary
    XML_PARSE_NSCLEAN,// = 8192 : remove redundant namespaces declarations
    XML_PARSE_NOCDATA,// = 16384 : merge CDATA as text nodes
    XML_PARSE_NOXINCNODE,// = 32768 : do not generate XINCLUDE START/END nodes
    XML_PARSE_COMPACT,// = 65536 : compact small text nodes; no modification of 
the tree allowed afterwards (will possibly crash if you try to modify the tree)
    XML_PARSE_OLD10,// = 131072 : parse using XML-1.0 before update 5
    XML_PARSE_NOBASEFIX,// = 262144 : do not fixup XINCLUDE xml:base uris
    XML_PARSE_HUGE,// = 524288 : relax any hardcoded limit from the parser
    XML_PARSE_OLDSAX; // = 1048576 : parse using SAX2 interface from before 
2.7.0


Now, cenum automagically gives you equality for this. You still have to write 
out
a str function (should be fixed!). However there is a problem: the str
function handle ALL the constants. Normally, only the ones that get used would
appear in the generated C++, so if some were platform dependent, it wouldn't
matter.

Ok, the second thing is: obviously, these are bit flags. It isn't an enumeration
of values, but an enumeration of bits. There's an easy way to define this:

inherit Bits[xmlParserOption];

(in this case you don't even need an instance, all the operations are defined 
in C)

Still .. it would be nice if you could just say

cflags xmlParserOption= .......;


--
john skaller
skal...@users.sourceforge.net





------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to