1 /*****************************************************************************\
4 * Author : Chris Koeritz *
8 * A simple test object for amorphs. *
10 *******************************************************************************
11 * Copyright (c) 1996-$now By Author. This program is free software; you can *
12 * redistribute it and/or modify it under the terms of the GNU General Public *
13 * License as published by the Free Software Foundation; either version 2 of *
14 * the License or (at your option) any later version. This is online at: *
15 * http://www.fsf.org/copyleft/gpl.html *
16 * Please send any updates to: fred@gruntose.com *
17 \*****************************************************************************/
23 using namespace basis;
24 using namespace structures;
26 bogon::bogon(abyte *to_copy) : my_held(NULL_POINTER)
29 astring t((char *)to_copy);
31 my_held = new abyte[t.length() + 1];
32 t.stuff((char *)my_held, t.length() + 1);
37 bogon::bogon(const bogon &to_copy) : my_held(NULL_POINTER) { operator = (to_copy); }
39 bogon &bogon::operator = (const bogon &to_copy) {
40 if (this == &to_copy) return *this;
41 astring t((char *)to_copy.my_held);
42 if (my_held) delete [] my_held;
43 my_held = new abyte[t.length() + 1];
44 t.stuff((char *)my_held, t.length() + 1);
48 bogon::~bogon() { if (my_held) delete [] my_held; }
50 abyte *bogon::held() const { return my_held; }
52 int bogon::size() const { return my_held? int(strlen((char *)my_held) + 1) : 0; }