aboutsummaryrefslogtreecommitdiff
path: root/c++-libbu++/src/tests/clone.cpp
blob: bfb7b2782bb8e2c6080538a40a52ca6e02cb604c (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-2012 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;
}