From fba73219e3c7bf65b459a3303f579fd83c8fd0af Mon Sep 17 00:00:00 2001 From: Mike Buland Date: Fri, 6 Apr 2012 06:16:33 +0000 Subject: Everything supports clone now. --- src/dictionary.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/dictionary.cpp') 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() } } +Gats::Object *Gats::Dictionary::clone() const +{ + Gats::Dictionary *pClone = new Gats::Dictionary; + for( const_iterator i = begin(); i; i++ ) + { + Bu::String s(i.getKey()); + pClone->insert( s.clone(), (*i)->clone() ); + } + + return pClone; +} + void Gats::Dictionary::write( Bu::Stream &rOut ) const { rOut.write("d", 1 ); -- cgit v1.2.3