lib

dict.cpp
1/***************************************************************************
2 * dict.cpp
3 * This file is part of the KDE project
4 * copyright (C)2004-2005 by Sebastian Sauer (mail@dipe.org)
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
14 * You should have received a copy of the GNU Library General Public License
15 * along with this program; see the file COPYING. If not, write to
16 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18 ***************************************************************************/
19
20#include "dict.h"
21//#include "exception.h"
22
23using namespace Kross::Api;
24
25Dict::Dict(const TQMap<TQString, Object::Ptr> value)
26 : Value< List, TQMap<TQString, Object::Ptr> >(value)
27{
28}
29
31{
32}
33
34const TQString Dict::getClassName() const
35{
36 return "Kross::Api::Dict";
37}
38
39const TQString Dict::toString()
40{
41 TQString s = "[";
42 TQMap<TQString, Object::Ptr> list = getValue();
43 for(TQMap<TQString, Object::Ptr>::Iterator it = list.begin(); it != list.end(); ++it)
44 s += "'" + it.key() + "' = '" + it.data()->toString() + "', ";
45 return (s.endsWith(", ") ? s.left(s.length() - 2) : s) + "]";
46}
47
virtual ~Dict()
Destructor.
Definition dict.cpp:30
Dict(const TQMap< TQString, Object::Ptr > value)
Constructor.
Definition dict.cpp:25
virtual const TQString getClassName() const
Definition dict.cpp:34
virtual const TQString toString()
Definition dict.cpp:39
The List class implementates Value to handle lists and collections.
Definition list.h:39
The common Object class all other object-classes are inheritated from.
Definition object.h:50
TDESharedPtr< Object > Ptr
Shared pointer to implement reference-counting.
Definition object.h:56
TQMap< TQString, Object::Ptr > & getValue()
Definition value.h:64
Value(TQMap< TQString, Object::Ptr > value)
Definition value.h:48
The common Kross API used as common codebase.
Definition callable.h:33