Eneboo - Documentación para desarrolladores
|
00001 /**************************************************************************** 00002 ** $Id: qsregexp_object.h 1.1.5 edited 2006-02-23T15:39:57$ 00003 ** 00004 ** Copyright (C) 2001-2006 Trolltech AS. All rights reserved. 00005 ** 00006 ** This file is part of the Qt Script for Applications framework (QSA). 00007 ** 00008 ** This file may be distributed and/or modified under the terms of the 00009 ** GNU General Public License version 2 as published by the Free Software 00010 ** Foundation and appearing in the file LICENSE.GPL included in the 00011 ** packaging of this file. 00012 ** 00013 ** Licensees holding a valid Qt Script for Applications license may use 00014 ** this file in accordance with the Qt Script for Applications License 00015 ** Agreement provided with the Software. 00016 ** 00017 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 00018 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 00019 ** 00020 ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for 00021 ** information about QSA Commercial License Agreements. 00022 ** See http://www.trolltech.com/gpl/ for GPL licensing information. 00023 ** 00024 ** Contact info@trolltech.com if any conditions of this licensing are 00025 ** not clear to you. 00026 ** 00027 *****************************************************************************/ 00028 00029 #ifndef QSREGEXP_OBJECT_H 00030 #define QSREGEXP_OBJECT_H 00031 00032 #include "qsclass.h" 00033 #include <qstringlist.h> 00034 00035 class QSRegExpClass : public QSWritableClass 00036 { 00037 public: 00038 QSRegExpClass(QSClass *b); 00039 QString name() const { 00040 return QString::fromLatin1("RegExp"); 00041 } 00042 00043 virtual QSObject fetchValue(const QSObject *objPtr, 00044 const QSMember &mem) const; 00045 virtual void write(QSObject *objPtr, const QSMember &mem, 00046 const QSObject &val) const; 00047 00048 00049 QString toString(const QSObject *obj) const; 00050 00051 QSObject construct(const QSList &args) const; 00052 QSObject cast(const QSList &args) const; 00053 00054 static QRegExp *regExp(const QSObject *obj); 00055 00056 // ECMA API 00057 static QSObject exec(QSEnv *env); 00058 static QSObject test(QSEnv *env); 00059 static QSObject toStringScript(QSEnv *env); 00060 // QRegExp API 00061 static QSObject search(QSEnv *env); 00062 static QSObject searchRev(QSEnv *env); 00063 static QSObject exactMatch(QSEnv *env); 00064 static QSObject pos(QSEnv *env); 00065 static QSObject cap(QSEnv *env); 00066 00067 QStringList lastCaptures; 00068 00069 static QString source(const QSObject *re); 00070 static bool isGlobal(const QSObject *re); 00071 static bool isIgnoreCase(const QSObject *re); 00072 00073 private: 00074 static QRegExp *regExp(QSEnv *e); 00075 }; 00076 00077 #endif