#include <bu/json.h>
#include <bu/file.h>
#include <bu/sio.h>
#include <bu/streamstack.h>

int main( int argc, char *argv[] )
{
    Bu::Json j( "\x01" "ACTION" "\x01" );
    Bu::println( j.toString() );

    Bu::Json ob( Bu::Json::Object );
    ob.insert("hello", 47.0 );
    const Bu::Json &obRef = ob;
    Bu::println("%1").arg( obRef["hello"] );

    return 0;
}

void hi()
{
    Bu::File fIn( "test1.json", Bu::File::Read );
    Bu::Json ob( fIn );
    ob.write( Bu::sioRaw );
    Bu::println("\n");
    Bu::String back1 = ob.toStringStable();
    Bu::Json ob2( back1 );
    Bu::String back2 = ob2.toStringStable();
    Bu::println( back1 );
    Bu::println( back2 );
    if( back1 == back2 )
        Bu::println("loop success");
    else
        Bu::println("loop failure");
}

