Eneboo - Documentación para desarrolladores
src/qt/tools/designer/plugins/cppeditor/yyreg.h
Ir a la documentación de este archivo.
00001 /**********************************************************************
00002 **
00003 ** Copyright (C) 2005-2007 Trolltech ASA.  All rights reserved.
00004 **
00005 ** This file is part of Qt Designer.
00006 **
00007 ** This file may be distributed and/or modified under the terms of the
00008 ** GNU General Public License version 2 as published by the Free Software
00009 ** Foundation and appearing in the file LICENSE.GPL included in the
00010 ** packaging of this file.
00011 **
00012 ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
00013 ** licenses may use this file in accordance with the Qt Commercial License
00014 ** Agreement provided with the Software.
00015 **
00016 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00017 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00018 **
00019 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
00020 ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
00021 **   information about Qt Commercial License Agreements.
00022 **
00023 ** Contact info@trolltech.com if any conditions of this licensing are
00024 ** not clear to you.
00025 **
00026 **********************************************************************/
00027 
00028 #ifndef YYREG_H
00029 #define YYREG_H
00030 
00031 #include <qstringlist.h>
00032 #include <qvaluelist.h>
00033 
00034 class CppFunction
00035 {
00036 public:
00037     CppFunction() : cnst( FALSE ), lineno1( 0 ), lineno2( 0 ) { }
00038 
00039     void setReturnType( const QString& r ) { ret = r; }
00040     void setScopedName( const QString& n ) { nam = n; }
00041     void setParameterList( const QStringList& p ) { params = p; }
00042     void setConst( bool c ) { cnst = c; }
00043     void setBody( const QString& b ) { bod = b; }
00044     void setDocumentation( const QString& d ) { doc = d; }
00045     void setLineNums( int functionStart, int openingBrace, int closingBrace ) {
00046         lineno0 = functionStart;
00047         lineno1 = openingBrace;
00048         lineno2 = closingBrace;
00049     }
00050 
00051     const QString& returnType() const { return ret; }
00052     const QString& scopedName() const { return nam; }
00053     const QStringList& parameterList() const { return params; }
00054     bool isConst() const { return cnst; }
00055     QString prototype() const;
00056     const QString& body() const { return bod; }
00057     const QString& documentation() const { return doc; }
00058     int functionStartLineNum() const { return lineno0; }
00059     int openingBraceLineNum() const { return lineno1; }
00060     int closingBraceLineNum() const { return lineno2; }
00061 
00062 #if defined(Q_FULL_TEMPLATE_INSTANTIATION)
00063     bool operator==( const CppFunction& ) const { return FALSE; }
00064 #endif
00065 
00066 private:
00067     QString ret;
00068     QString nam;
00069     QStringList params;
00070     bool cnst;
00071     QString bod;
00072     QString doc;
00073     int lineno0;
00074     int lineno1;
00075     int lineno2;
00076 };
00077 
00078 void extractCppFunctions( const QString& code, QValueList<CppFunction> *flist );
00079 QString canonicalCppProto( const QString& proto );
00080 
00081 #endif
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'