• Skip to content
  • Skip to link menu
KDE 4.1 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

Kross

Kross::InterpreterInfo

Kross::InterpreterInfo Class Reference

#include <interpreter.h>

List of all members.


Detailed Description

The InterpreterInfo class provides abstract information about a Interpreter before the interpreter-backend itself is loaded.

Definition at line 43 of file core/interpreter.h.


Public Member Functions

bool hasOption (const QString &name) const
Interpreter * interpreter ()
 InterpreterInfo (const QString &interpretername, void *funcPtr, const QString &wildcard, const QStringList &mimetypes, const Option::Map &options=Option::Map())
const QString interpreterName () const
const QStringList mimeTypes () const
Option * option (const QString &name) const
Option::Map & options ()
const QVariant optionValue (const QString &name, const QVariant &defaultvalue=QVariant()) const
const QString wildcard () const
 ~InterpreterInfo ()

Classes

class  Option
 Each interpreter is able to define options we could use to manipulate the interpreter behaviour. More...

Constructor & Destructor Documentation

InterpreterInfo::InterpreterInfo ( const QString &  interpretername,
void *  funcPtr,
const QString &  wildcard,
const QStringList &  mimetypes,
const Option::Map &  options = Option::Map() 
)

Constructor.

Parameters:
interpretername The name of the interpreter. The name is used internaly as unique identifier for the interpreter and could be for example "python", "ruby" or "javascript".
funcPtr A pointer to the entry function within the library. The entry function each interpreter-backend does provide looks like this;
 typedef void* (*def_interpreter_func)(int version, Kross::InterpreterInfo*);
The def_interpreter_func function will be used by Kross to load the interpreter's library. The passed version is used to be able to versioning details and we use the KROSS_VERSION defined within the krossconfig.h file here.
wildcard File wildcard that identifies a by the interpreter supported scripting files. As example Python does define here "*.py" while Java does define "*.java *.class".
mimetypes The file mimetype that identifies a by the interpreter supported scripting files. As example Python does define "text/x-python" here while Ruby defines "application/x-ruby" and Java "application/java".
options The optional list of options supported by the interpreter to configure the backend.

Definition at line 58 of file core/interpreter.cpp.

InterpreterInfo::~InterpreterInfo (  ) 

Destructor.

Definition at line 69 of file core/interpreter.cpp.


Member Function Documentation

bool InterpreterInfo::hasOption ( const QString &  name  )  const

Returns:
true if an Option with that key exists else false.

Definition at line 91 of file core/interpreter.cpp.

Interpreter * InterpreterInfo::interpreter (  ) 

Returns:
the Interpreter instance this InterpreterInfo is the describer for.

If the interpreter that implements the scripting backend isn't loaded yet, this method will trigger the loading of the interpreter's library. Note that this method may return NULL if there is no library for that interpreter installed or if the library is incompatible.

Definition at line 111 of file core/interpreter.cpp.

const QString InterpreterInfo::interpreterName (  )  const

Returns:
the name of the interpreter.

For example "python" or "kjs".

Definition at line 76 of file core/interpreter.cpp.

const QStringList InterpreterInfo::mimeTypes (  )  const

List of mimetypes this interpreter supports.

Returns:
QStringList with mimetypes like "application/javascript".

Definition at line 86 of file core/interpreter.cpp.

InterpreterInfo::Option * InterpreterInfo::option ( const QString &  name  )  const

Returns:
the option defined with name .

Definition at line 96 of file core/interpreter.cpp.

InterpreterInfo::Option::Map & InterpreterInfo::options (  ) 

Returns:
the reference to the intenal used map with all options.

Definition at line 101 of file core/interpreter.cpp.

const QVariant InterpreterInfo::optionValue ( const QString &  name,
const QVariant &  defaultvalue = QVariant() 
) const

Returns:
the value of the option defined with name .

If there doesn't exists an option with such a name, the defaultvalue is returned.

Definition at line 106 of file core/interpreter.cpp.

const QString InterpreterInfo::wildcard (  )  const

Returns:
the file-wildcard used to determinate by this interpreter used scriptingfiles.

Those filter will be used e.g. with KGlobal::dirs()->findAllResources() as filtermask. For example python just defines it as "*py".

Definition at line 81 of file core/interpreter.cpp.


The documentation for this class was generated from the following files:
  • core/interpreter.h
  • core/interpreter.cpp

Kross

Skip menu "Kross"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • KIO
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal