From 52bac339b6267aa9aaa3e2e0d02c2a62e47f83e4 Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 6 Apr 2012 06:57:51 +0000 Subject: Qt is tested more thoroughly, some read bugs are fixed. It also works better with qt principles. You can hook up the readyRead signal to the readObject slot on GatsStream, and connect the GatsStream objectRead signal to your own functions, and you'll be notified whenever a new gats object is read. Cool. --- src/tests/clone.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 src/tests/clone.cpp (limited to 'src/tests') diff --git a/src/tests/clone.cpp b/src/tests/clone.cpp new file mode 100644 index 0000000..8533376 --- /dev/null +++ b/src/tests/clone.cpp @@ -0,0 +1,22 @@ +#include "gats/types.h" + +#include + +using namespace Bu; + +int main( int argc, char *argv[] ) +{ + Gats::Object *pBase = Gats::Object::strToGats("{\"Thing\": 3.14159, \"bool\": true, \"list\":[\"string\",44,{\"Stuff\":{\"list\":[],\"what?\":false}}]}"); + + sio << *pBase << sio.nl; + + Gats::Object *pNew = pBase->clone(); + delete pBase; + + sio << *pNew << sio.nl; + + delete pNew; + + return 0; +} + -- cgit v1.2.3