diff options
author | Mike Buland <eichlan@xagasoft.com> | 2012-04-06 06:16:33 +0000 |
---|---|---|
committer | Mike Buland <eichlan@xagasoft.com> | 2012-04-06 06:16:33 +0000 |
commit | fba73219e3c7bf65b459a3303f579fd83c8fd0af (patch) | |
tree | 7de25030a1ef0e5899da243c2fb5c0e4900c0a49 /src/dictionary.cpp | |
parent | b01618b1be4831d30dbf8706a48e71c62d617b99 (diff) | |
download | libgats-fba73219e3c7bf65b459a3303f579fd83c8fd0af.tar.gz libgats-fba73219e3c7bf65b459a3303f579fd83c8fd0af.tar.bz2 libgats-fba73219e3c7bf65b459a3303f579fd83c8fd0af.tar.xz libgats-fba73219e3c7bf65b459a3303f579fd83c8fd0af.zip |
Everything supports clone now.
Diffstat (limited to 'src/dictionary.cpp')
-rw-r--r-- | src/dictionary.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/dictionary.cpp b/src/dictionary.cpp index 9728804..b59d652 100644 --- a/src/dictionary.cpp +++ b/src/dictionary.cpp | |||
@@ -26,6 +26,18 @@ Gats::Dictionary::~Dictionary() | |||
26 | } | 26 | } |
27 | } | 27 | } |
28 | 28 | ||
29 | Gats::Object *Gats::Dictionary::clone() const | ||
30 | { | ||
31 | Gats::Dictionary *pClone = new Gats::Dictionary; | ||
32 | for( const_iterator i = begin(); i; i++ ) | ||
33 | { | ||
34 | Bu::String s(i.getKey()); | ||
35 | pClone->insert( s.clone(), (*i)->clone() ); | ||
36 | } | ||
37 | |||
38 | return pClone; | ||
39 | } | ||
40 | |||
29 | void Gats::Dictionary::write( Bu::Stream &rOut ) const | 41 | void Gats::Dictionary::write( Bu::Stream &rOut ) const |
30 | { | 42 | { |
31 | rOut.write("d", 1 ); | 43 | rOut.write("d", 1 ); |