STF Utility (updated!)

The SSS STF (a cool new format for storing data with multiple levels but still > XML, more info here) parser is almost finished. I’m trying to simplify it up as we speak. C++ Templates sure can be frustrating! “/me twitches with his eyes.”

So the parser was working, but it didn’t utilize C++ all the way. I’m trying to reduce the code and thus ease further development and maintainability.

Some hours later…

It is finished! As far as I can tell anyway.  It has a nice example app with it, here’s a (now already dated) sneak peek:

    prettyprint("Welcome to the SSS example app");
cout
<< "This application shows how easy it is to use SSS.\n"
<< "STF is a \"new\" way to store leveled data, just as XML can do, for example.\n"
<< "The format looks like a C(++) struct, which we think is easier to read than XML.\n"
<< "Each :{ is a node, a node has other nodes and values. The first node is unnamed.\n"
<< endl;

So what are you waiting for? Grab the source with example app from the SourceForge page (either checkout from the SVN or select “Browse SVN” -> “Download GNU tarball” (all the way down) ), and use this neat alternative to XML! More information after the break.

Its documentation is made with Doxygen (nice program by the way, never used it until today, and it creates nice documentation) and can be found here(with left explorer style bar) and here(without). With the documentation is the code for review by you, because I’d like some comments where I could improve. About half of it was first written by Maurice Bos of BosByte and then completely reviewed and altered by me. Then I added the other half. I tried to use C++’s features where I could, and I’m quite happy with the results.

So again, comments on the code are welcome! You can view the code in the documentation.

What did you say? How it looks?

Like this:

imthefirst: "The first value!"
name with spaces: "Names can contain spaces"
name
with
newlines: "And even newlines!"

test: {
    blah: "The value of [root].test.blah"
    newlines: "newlines and all their whitespace
             get stored"
    comment: This comment value contains some information about how to comment in SSS files.
    "You can place comment before the quotes, the parser will ignore it."
    output this: "This particular value is retrieved in the code."
    output child:
    Same goes for children. The parser ignores anything until a curly bracket is found. {
        info: "Awwwwwwright! Tree output oh yeah."
        coolness: "+20"
    }
    Array: { :"This" :"is" :"like" :"an" :"array" }

    2D array:
    {
            : { :"First" :"Row" }
            : { :"Second" :"Row" :"!" }
    }
}

But seriously, go check out the SF page, download the STFU and play around with it. It oozes simplicity.

One Response to “STF Utility (updated!)”

  1. tux4life says:

    It might be useful to give some more details about your sss-parser and what it does on your homepage :)

Leave a Reply