vendredi 31 décembre 2010

sylisa camp-json is on gitorious :-)

The serializer from C++ to JSON using CAMP is now on gitorious.

The build system is qmake and it is under the boost license.

BTW I plan to use CAMP for my dblite library, I am just curious to see how it fits :-)

best regards & happy new year 2011
Sylvain

sylisa-dblite is born :-) - a sqlite wrapper C++ library

I searched a library to be easily embedded in an c++ application (like sqlite amalgamation), with a good license like boost.
A long time ago, I went on SOCI and it was really good to see this kind of syntax.

Unfortunately, sqlite is available in the git repository only, and not officially supported.
Furthermore, after having a look on the code, I saw that everything was retrieve as "string" and I was not able to modify it easily as the internals were complex enough.

Then, I decided to give a try to have a simpler library but having a better fit with sqlite.

This is an early version for now, but still it is functional, and should answer already most of the needs.
I am anyway working on it.

In the future, I would like to integrate more database (sqlite will stay the first one first class), why not using SOCI as an underlying layer to access other databases? I would like to, "challenge accepted" :-)

The library is available under the boost license on gitorious
http://gitorious.org/sylisa-dblite

I hope some others will join of course :-)

Bye, I wish you all the best for the next coming year

lundi 13 décembre 2010

CAMP JSON Serializer

I wrote the last week an module for CAMP for an output to JSON.

There was already one existing called camp-json but it uses a c library behind, that obliged to have another dependency and an additional memory structure before the serialization.

I removed this dependency and the additional structure by serializing directly in JSON.
I also detect if Qt is used in CAMP and I output the Qt String into UTF-8, as I think it is the standard on the web.

so you can use it like:


    MyClass o;
    camp::UserObject object = o;

    QString json;
    QTextStream ts( &json );

    camp::json_serializer::serialize( ts, object, "nojson" );
    ts.flush();
    std::cout << json.toStdString();

You can find the module source code here, the CAMP forum

I would be very happy to hear your comments and critics.

bye

mardi 7 décembre 2010

CAMP reflexion library

Few month ago, I discovered CAMP, a library that I could use to access dynamically my properties and functions. It is really wonderful! very simple!

I am currently writing a json serialiser that is not using an intermediate representation to do the output. As you may know, I like Qt and this lib detects the QString to output in the UTF-8 format.
 
https://dev.tegesoft.com/projects/camp


happy coding :-)