diff options
author | Mike Buland <eichlan@xagasoft.com> | 2012-04-06 06:57:51 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2012-04-06 06:57:51 +0000 |
commit | 52bac339b6267aa9aaa3e2e0d02c2a62e47f83e4 (patch) | |
tree | b5e9f366a86d679495dd50790e150933da892d7a /src/tests | |
parent | fe9f6c6bbc9e682af709fe08757c31ba17a298d1 (diff) | |
download | libgats-52bac339b6267aa9aaa3e2e0d02c2a62e47f83e4.tar.gz libgats-52bac339b6267aa9aaa3e2e0d02c2a62e47f83e4.tar.bz2 libgats-52bac339b6267aa9aaa3e2e0d02c2a62e47f83e4.tar.xz libgats-52bac339b6267aa9aaa3e2e0d02c2a62e47f83e4.zip |
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.
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/clone.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
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 @@ | |||
1 | #include "gats/types.h" | ||
2 | |||
3 | #include <bu/sio.h> | ||
4 | |||
5 | using namespace Bu; | ||
6 | |||
7 | int main( int argc, char *argv[] ) | ||
8 | { | ||
9 | Gats::Object *pBase = Gats::Object::strToGats("{\"Thing\": 3.14159, \"bool\": true, \"list\":[\"string\",44,{\"Stuff\":{\"list\":[],\"what?\":false}}]}"); | ||
10 | |||
11 | sio << *pBase << sio.nl; | ||
12 | |||
13 | Gats::Object *pNew = pBase->clone(); | ||
14 | delete pBase; | ||
15 | |||
16 | sio << *pNew << sio.nl; | ||
17 | |||
18 | delete pNew; | ||
19 | |||
20 | return 0; | ||
21 | } | ||
22 | |||