lib
argument.cpp
00001 /*************************************************************************** 00002 * argument.cpp 00003 * This file is part of the KDE project 00004 * copyright (C)2004-2005 by Sebastian Sauer (mail@dipe.org) 00005 * 00006 * This program is free software; you can redistribute it and/or 00007 * modify it under the terms of the GNU Library General Public 00008 * License as published by the Free Software Foundation; either 00009 * version 2 of the License, or (at your option) any later version. 00010 * This program is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 * Library General Public License for more details. 00014 * You should have received a copy of the GNU Library General Public License 00015 * along with this program; see the file COPYING. If not, write to 00016 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00017 * Boston, MA 02110-1301, USA. 00018 ***************************************************************************/ 00019 00020 #include "argument.h" 00021 00022 using namespace Kross::Api; 00023 00024 Argument::Argument(const QString& classname /*, Object::Ptr object, bool visible*/) 00025 : m_classname(classname) 00026 //, m_object(object) 00027 //, m_visible(visible) 00028 { 00029 } 00030 00031 Argument::~Argument() 00032 { 00033 } 00034 00035 const QString& Argument::getClassName() 00036 { 00037 return m_classname; 00038 } 00039 00040 /* 00041 Object::Ptr Argument::getObject() const 00042 { 00043 return m_object; 00044 } 00045 00046 bool Argument::isVisible() const 00047 { 00048 return m_visible; 00049 } 00050 */ 00051 00052 ArgumentList& Argument::operator << (ArgumentList& arglist) 00053 { 00054 arglist << *this; 00055 return arglist; 00056 } 00057 00058 ArgumentList::ArgumentList() 00059 //: m_minparams(0) 00060 //, m_maxparams(0) 00061 { 00062 } 00063 00064 ArgumentList::~ArgumentList() 00065 { 00066 } 00067 00068 ArgumentList& ArgumentList::operator << (const Argument& arg) 00069 { 00070 /* 00071 if(arg.isVisible()) { 00072 if(! arg.getObject()) 00073 m_minparams++; 00074 m_maxparams++; 00075 } 00076 */ 00077 m_arguments.append(arg); 00078 return *this; 00079 } 00080 00081 /* 00082 uint ArgumentList::getMinParams() const 00083 { 00084 return m_minparams; 00085 } 00086 00087 uint ArgumentList::getMaxParams() const 00088 { 00089 return m_maxparams; 00090 } 00091 00092 QString ArgumentList::toString() 00093 { 00094 QString s; 00095 for(QValueList<Argument>::iterator it = m_arguments.begin(); it != m_arguments.end(); ++it) 00096 s += (*it).getClassName() + ", "; 00097 return s; 00098 } 00099 */