Qt 4.8
Classes | Namespaces | Functions | Variables
qscriptengine.cpp File Reference
#include "config.h"
#include "qscriptengine.h"
#include "qscriptsyntaxchecker_p.h"
#include "qscriptengine_p.h"
#include "qscriptengineagent_p.h"
#include "qscriptcontext_p.h"
#include "qscriptstring_p.h"
#include "qscriptvalue_p.h"
#include "qscriptvalueiterator.h"
#include "qscriptclass.h"
#include "qscriptcontextinfo.h"
#include "qscriptprogram.h"
#include "qscriptprogram_p.h"
#include "qdebug.h"
#include <QtCore/qstringlist.h>
#include <QtCore/qmetaobject.h>
#include <math.h>
#include "CodeBlock.h"
#include "Error.h"
#include "Interpreter.h"
#include "ExceptionHelpers.h"
#include "PrototypeFunction.h"
#include "InitializeThreading.h"
#include "ObjectPrototype.h"
#include "SourceCode.h"
#include "FunctionPrototype.h"
#include "TimeoutChecker.h"
#include "JSFunction.h"
#include "Parser.h"
#include "PropertyNameArray.h"
#include "Operations.h"
#include "bridge/qscriptfunction_p.h"
#include "bridge/qscriptclassobject_p.h"
#include "bridge/qscriptvariant_p.h"
#include "bridge/qscriptqobject_p.h"
#include "bridge/qscriptglobalobject_p.h"
#include "bridge/qscriptactivationobject_p.h"
#include "bridge/qscriptstaticscopeobject_p.h"
#include <QtCore/qcoreapplication.h>
#include <QtCore/qdir.h>
#include <QtCore/qfile.h>
#include <QtCore/qfileinfo.h>
#include <QtCore/qpluginloader.h>
#include <QtCore/qset.h>
#include <QtCore/qtextstream.h>
#include "qscriptextensioninterface.h"
#include "moc_qscriptengine.cpp"

Go to the source code of this file.

Classes

class  QScript::TimeoutCheckerProxy
 
class  QScriptSyntaxCheckResultPrivate
 
class  QScriptTypeInfo
 

Namespaces

 QScript
 

Functions

static QScriptValue QScript::__setupPackage__ (QScriptContext *ctx, QScriptEngine *eng)
 
qsreal QScript::DateTimeToMs (JSC::ExecState *exec, const QDateTime &dt)
 Converts a QDateTime to a JS date value (milliseconds). More...
 
static JSC::JSValue JSC_HOST_CALL QScript::functionConnect (JSC::ExecState *, JSC::JSObject *, JSC::JSValue, const JSC::ArgList &)
 
static JSC::JSValue JSC_HOST_CALL QScript::functionDisconnect (JSC::ExecState *, JSC::JSObject *, JSC::JSValue, const JSC::ArgList &)
 
static JSC::JSValue JSC_HOST_CALL QScript::functionGC (JSC::ExecState *, JSC::JSObject *, JSC::JSValue, const JSC::ArgList &)
 
static JSC::JSValue JSC_HOST_CALL QScript::functionPrint (JSC::ExecState *, JSC::JSObject *, JSC::JSValue, const JSC::ArgList &)
 
static JSC::JSValue JSC_HOST_CALL QScript::functionQsTr (JSC::ExecState *, JSC::JSObject *, JSC::JSValue, const JSC::ArgList &)
 
static JSC::JSValue JSC_HOST_CALL QScript::functionQsTranslate (JSC::ExecState *, JSC::JSObject *, JSC::JSValue, const JSC::ArgList &)
 
static JSC::JSValue JSC_HOST_CALL QScript::functionQsTranslateNoOp (JSC::ExecState *, JSC::JSObject *, JSC::JSValue, const JSC::ArgList &)
 
static JSC::JSValue JSC_HOST_CALL QScript::functionQsTrId (JSC::ExecState *, JSC::JSObject *, JSC::JSValue, const JSC::ArgList &)
 
static JSC::JSValue JSC_HOST_CALL QScript::functionQsTrIdNoOp (JSC::ExecState *, JSC::JSObject *, JSC::JSValue, const JSC::ArgList &)
 
static JSC::JSValue JSC_HOST_CALL QScript::functionQsTrNoOp (JSC::ExecState *, JSC::JSObject *, JSC::JSValue, const JSC::ArgList &)
 
static JSC::JSValue JSC_HOST_CALL QScript::functionVersion (JSC::ExecState *, JSC::JSObject *, JSC::JSValue, const JSC::ArgList &)
 
qsreal QScript::integerFromString (const char *buf, int size, int radix)
 
qsreal QScript::integerFromString (const QString &str, int radix)
 
bool QScript::isFunction (JSC::JSValue value)
 
static int QScript::MsFromTime (qsreal t)
 
QDateTime QScript::MsToDateTime (JSC::ExecState *exec, qsreal t)
 Converts a JS date value (milliseconds) to a QDateTime (local time). More...
 
Q_CORE_EXPORT QString qt_regexp_toCanonical (const QString &, QRegExp::PatternSyntax)
 
static JSC::JSValue JSC_HOST_CALL QScript::stringProtoFuncArg (JSC::ExecState *, JSC::JSObject *, JSC::JSValue, const JSC::ArgList &)
 
static int QScript::toDigit (char c)
 
qint32 QScript::ToInt32 (qsreal n)
 
qsreal QScript::ToInteger (qsreal n)
 
quint16 QScript::ToUInt16 (qsreal n)
 
quint32 QScript::ToUInt32 (qsreal n)
 

Variables

static const qsreal QScript::D32 = 4294967296.0
 
static const qsreal QScript::MsPerSecond = 1000.0
 

Function Documentation

◆ qt_regexp_toCanonical()

Q_CORE_EXPORT QString qt_regexp_toCanonical ( const QString pattern,
QRegExp::PatternSyntax  patternSyntax 
)
Warning
This function is not part of the public interface. convert the pattern string to the RegExp syntax.

This is also used by QScriptEngine::newRegExp to convert to a pattern that JavaScriptCore can understan

Definition at line 1323 of file qregexp.cpp.

Referenced by QScriptEnginePrivate::detachAllRegisteredScriptStrings(), QScriptEnginePrivate::newRegExp(), and QRegExpEngine::QRegExpEngine().

1324 {
1325  switch (patternSyntax) {
1326 #ifndef QT_NO_REGEXP_WILDCARD
1327  case QRegExp::Wildcard:
1328  return wc2rx(pattern, false);
1329  break;
1330  case QRegExp::WildcardUnix:
1331  return wc2rx(pattern, true);
1332  break;
1333 #endif
1334  case QRegExp::FixedString:
1335  return QRegExp::escape(pattern);
1336  break;
1338  default:
1339  return pattern;
1340  }
1341 }
static QString wc2rx(const QString &wc_str, const bool enableEscaping)
Definition: qregexp.cpp:761
static QString escape(const QString &str)
Returns the string str with every regexp special character escaped with a backslash.
Definition: qregexp.cpp:4392