aboutsummaryrefslogtreecommitdiff
path: root/c++-libbu++/src/tests/clone.cpp
blob: 45b2fcaf6db99ae5ac01976ad332f4c532f2a2a8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
/*
 * Copyright (C) 2007-2013 Xagasoft, All rights reserved.
 *
 * This file is part of the libgats library and is released under the
 * terms of the license contained in the file LICENSE.
 */

#include "gats/types.h"

#include <bu/sio.h>

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;
}