Qt 4.8
Public Functions | Static Public Functions | Protected Functions | Protected Variables | List of all members
QScript::UStringSourceProviderWithFeedback Class Reference

#include <qscriptengine_p.h>

Inheritance diagram for QScript::UStringSourceProviderWithFeedback:

Public Functions

int columnNumberFromOffset (int offset) const
 
void disconnectFromEngine ()
 
virtual ~UStringSourceProviderWithFeedback ()
 

Static Public Functions

static PassRefPtr< UStringSourceProviderWithFeedbackcreate (const JSC::UString &source, const JSC::UString &url, int lineNumber, QScriptEnginePrivate *engine)
 

Protected Functions

JSC::Debugger * debugger ()
 
 UStringSourceProviderWithFeedback (const JSC::UString &source, const JSC::UString &url, int lineNumber, QScriptEnginePrivate *engine)
 

Protected Variables

QScriptEnginePrivatem_ptr
 

Detailed Description

Definition at line 429 of file qscriptengine_p.h.

Constructors and Destructors

◆ ~UStringSourceProviderWithFeedback()

virtual QScript::UStringSourceProviderWithFeedback::~UStringSourceProviderWithFeedback ( )
inlinevirtual

Definition at line 441 of file qscriptengine_p.h.

442  {
443  if (m_ptr) {
444  if (JSC::Debugger* debugger = this->debugger())
445  debugger->scriptUnload(asID());
446  m_ptr->loadedScripts.remove(asID());
447  }
448  }
int remove(const Key &key)
Removes all the items that have the key from the hash.
Definition: qhash.h:784
QHash< intptr_t, QScript::UStringSourceProviderWithFeedback * > loadedScripts

◆ UStringSourceProviderWithFeedback()

QScript::UStringSourceProviderWithFeedback::UStringSourceProviderWithFeedback ( const JSC::UString &  source,
const JSC::UString &  url,
int  lineNumber,
QScriptEnginePrivate engine 
)
inlineprotected

Definition at line 469 of file qscriptengine_p.h.

471  : UStringSourceProvider(source, url),
472  m_ptr(engine)
473  {
474  if (JSC::Debugger* debugger = this->debugger())
475  debugger->scriptLoad(asID(), source, url, lineNumber);
476  if (m_ptr)
477  m_ptr->loadedScripts.insert(asID(), this);
478  }
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
Definition: qhash.h:753
QHash< intptr_t, QScript::UStringSourceProviderWithFeedback * > loadedScripts

Functions

◆ columnNumberFromOffset()

int QScript::UStringSourceProviderWithFeedback::columnNumberFromOffset ( int  offset) const
inline

Definition at line 459 of file qscriptengine_p.h.

460  {
461  for (const UChar *c = m_source.data() + offset; c >= m_source.data(); --c) {
462  if (JSC::Lexer::isLineTerminator(*c))
463  return offset - static_cast<int>(c - data());
464  }
465  return offset + 1;
466  }
unsigned char c[8]
Definition: qnumeric_p.h:62
static const char * data(const QByteArray &arr)

◆ create()

static PassRefPtr<UStringSourceProviderWithFeedback> QScript::UStringSourceProviderWithFeedback::create ( const JSC::UString &  source,
const JSC::UString &  url,
int  lineNumber,
QScriptEnginePrivate engine 
)
inlinestatic

Definition at line 432 of file qscriptengine_p.h.

Referenced by QScriptEngine::evaluate(), and QScriptProgramPrivate::executable().

435  {
436  return adoptRef(new UStringSourceProviderWithFeedback(source, url, lineNumber, engine));
437  }
UStringSourceProviderWithFeedback(const JSC::UString &source, const JSC::UString &url, int lineNumber, QScriptEnginePrivate *engine)

◆ debugger()

JSC::Debugger* QScript::UStringSourceProviderWithFeedback::debugger ( )
inlineprotected

Definition at line 480 of file qscriptengine_p.h.

481  {
482  //if m_ptr is null it mean that QScriptEnginePrivate was destroyed and scriptUnload was called
483  //else m_ptr is stable and we can use it as normal pointer without hesitation
484  if(!m_ptr)
485  return 0; //we are in ~QScriptEnginePrivate
486  else
487  return m_ptr->originalGlobalObject()->debugger(); //QScriptEnginePrivate is still alive
488  }
JSC::JSGlobalObject * originalGlobalObject() const

◆ disconnectFromEngine()

void QScript::UStringSourceProviderWithFeedback::disconnectFromEngine ( )
inline

Definition at line 452 of file qscriptengine_p.h.

453  {
454  if (JSC::Debugger* debugger = this->debugger())
455  debugger->scriptUnload(asID());
456  m_ptr = 0;
457  }

Properties

◆ m_ptr

QScriptEnginePrivate* QScript::UStringSourceProviderWithFeedback::m_ptr
protected

Definition at line 491 of file qscriptengine_p.h.


The documentation for this class was generated from the following file: