Eneboo - Documentación para desarrolladores
src/qt/qmake/meta.h
Ir a la documentación de este archivo.
00001 /****************************************************************************
00002 ** $Id: qt/meta.h   3.3.8   edited Jan 11 14:37 $
00003 **
00004 ** Definition of QMakeMetaInfo class.
00005 **
00006 ** Copyright (C) 1992-2007 Trolltech ASA.  All rights reserved.
00007 **
00008 ** This file is part of qmake.
00009 **
00010 ** This file may be distributed under the terms of the Q Public License
00011 ** as defined by Trolltech ASA of Norway and appearing in the file
00012 ** LICENSE.QPL included in the packaging of this file.
00013 **
00014 ** This file may be distributed and/or modified under the terms of the
00015 ** GNU General Public License version 2 as published by the Free Software
00016 ** Foundation and appearing in the file LICENSE.GPL included in the
00017 ** packaging of this file.
00018 **
00019 ** Licensees holding valid Qt Enterprise Edition licenses may use this
00020 ** file in accordance with the Qt Commercial License Agreement provided
00021 ** with the Software.
00022 **
00023 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00024 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00025 **
00026 ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
00027 **   information about Qt Commercial License Agreements.
00028 ** See http://www.trolltech.com/qpl/ for QPL licensing information.
00029 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
00030 **
00031 ** Contact info@trolltech.com if any conditions of this licensing are
00032 ** not clear to you.
00033 **
00034 **********************************************************************/
00035 
00036 #ifndef __META_H__
00037 #define __META_H__
00038 
00039 #include <qmap.h>
00040 #include <qstringlist.h>
00041 #include <qstring.h>
00042 
00043 class QMakeMetaInfo 
00044 {
00045     bool readLibtoolFile(const QString &f);
00046     bool readPkgCfgFile(const QString &f);
00047     QMap<QString, QStringList> vars;
00048     QString meta_type;
00049     static QMap<QString, QMap<QString, QStringList> > cache_vars;
00050     void clear();
00051 public:
00052     QMakeMetaInfo();
00053 
00054     bool readLib(const QString &lib);
00055     static QString findLib(const QString &lib);
00056     static bool libExists(const QString &lib);
00057     QString type() const;
00058 
00059     bool isEmpty(const QString &v);
00060     QStringList &values(const QString &v);
00061     QString first(const QString &v);
00062     QMap<QString, QStringList> &variables();
00063 };
00064 
00065 inline bool QMakeMetaInfo::isEmpty(const QString &v)
00066 { return !vars.contains(v) || vars[v].isEmpty(); }
00067 
00068 inline QString QMakeMetaInfo::type() const
00069 { return meta_type; }
00070 
00071 inline QStringList &QMakeMetaInfo::values(const QString &v)
00072 { return vars[v]; }
00073 
00074 inline QString QMakeMetaInfo::first(const QString &v)
00075 {
00076 #if defined(Q_CC_SUN) && (__SUNPRO_CC == 0x500) || defined(Q_CC_HP)
00077     // workaround for Sun WorkShop 5.0 bug fixed in Forte 6
00078     if (isEmpty(v))
00079         return QString("");
00080     else
00081         return vars[v].first();
00082 #else
00083     return isEmpty(v) ? QString("") : vars[v].first();
00084 #endif
00085 }
00086 
00087 inline QMap<QString, QStringList> &QMakeMetaInfo::variables()
00088 { return vars; }
00089 
00090 inline bool QMakeMetaInfo::libExists(const QString &lib)
00091 { return !findLib(lib).isNull(); }
00092 
00093 #endif /* __META_H__ */
 Todo Clases Namespaces Archivos Funciones Variables 'typedefs' Enumeraciones Valores de enumeraciones Propiedades Amigas 'defines'