Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Showcase
  4. QDOMLite - Light weight DOM/XML

QDOMLite - Light weight DOM/XML

Scheduled Pinned Locked Moved Showcase
3 Posts 3 Posters 1.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    vemod 0
    wrote on last edited by vemod 0
    #1

    QDOMLite.h. Quick and Dirty Document Object Model. Fast and low-resource one-file XML.

    in your .pro:

    CONFIG += c++11
    DEFINES += QT_USE_QSTRINGBUILDER
    

    Parse example:

    QTreeWidgetItem* i = new QTreeWidgetItem({"Document"});
    ui->treeWidget->addTopLevelItem(i);
    QDomLiteDocument d("yourfile.xml");
    parseElement(d.documentElement,i);
     
    void parseElement(QDomLiteElement* e, QTreeWidgetItem* i)
    {
        for (QDomLiteElement* c : e->childElements) parseElement(c,new QTreeWidgetItem(i,{c->tag}));
    }
    

    File:

    https://www.dropbox.com/s/7q39f1y31g5y5xe/qdomlite.h?dl=0

    1 Reply Last reply
    2
    • K Offline
      K Offline
      Konstantin Tokarev
      wrote on last edited by
      #2

      https://pugixml.org/

      1 Reply Last reply
      2
      • V Offline
        V Offline
        vemod 0
        wrote on last edited by
        #3

        File has now been updated (still same link).

        QRegExp has been replaced with QRegularExpression. The fromString function now has some clever look-ahead and passes smaller substrings when recursing.

        Performance has been improved considerably, up to 100 times for really large files. Have fun!

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved