Menu

tinyxml error handling

Developer
2005-05-16
2013-05-20
  • Oleg Smolsky

    Oleg Smolsky - 2005-05-16

    I've jsut started using tinyxml and have a few questions/queries:

    - TiXmlDocument::LoadFile() fails when fed with an XML element that contains duplicate attributes, and it's difficult to figure out what's wrong:
        <table type="input" path="vhf.input" type="event">
        Do you think we can improve error handling here?
     
    - Many functions return "const char *" and I end up constructing std::string whenever I wanna do something with the result besides storing:
        assert(std::string(pnode->Value()) == "table");
        Would you be interested in adding/modifying these methods to return strings by instance?

     
    • Lee Thomason

      Lee Thomason - 2005-05-26

      - On the first point, did GetErrorRow() and GetErrorColumn() return the correct values?

      - On the 2nd, that's because of the STL switch. For STL on you would like:

      string Foo()

      but of course, for STL off you need:

      const char* Foo()

      ...but there's no way to overload, so it uses the const char* way and relies on an implicit cast.

      lee

       

Log in to post a comment.

MongoDB Logo MongoDB