Search for usage in LXR

Kross::InterpreterInfo Class Reference

#include <interpreter.h>


class  Option

Public Member Functions

 InterpreterInfo (const QString &interpretername, QFunctionPointer funcPtr, const QString &wildcard, const QStringList &mimetypes, const Option::Map &options=Option::Map())
 ~InterpreterInfo ()
bool hasOption (const QString &name) const
Interpreterinterpreter ()
const QString interpreterName () const
const QStringList mimeTypes () const
Optionoption (const QString &name) const
Option::Mapoptions ()
const QVariant optionValue (const QString &name, const QVariant &defaultvalue=QVariant()) const
const QString wildcard () const

Detailed Description

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

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

Constructor & Destructor Documentation

◆ InterpreterInfo()

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


interpreternameThe name of the interpreter. The name is used internally as unique identifier for the interpreter and could be for example "python", "ruby" or "javascript".
funcPtrA 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.
wildcardFile wildcard that identifies a by the interpreter supported scripting files. As example Python does define here "*.py" while Java does define "*.java *.class".
mimetypesThe 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".
optionsThe optional list of options supported by the interpreter to configure the backend.

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

◆ ~InterpreterInfo()

InterpreterInfo::~InterpreterInfo ( )


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

Member Function Documentation

◆ hasOption()

bool InterpreterInfo::hasOption ( const QString name) const
true if an Option with that key exists else false.

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

◆ interpreter()

Interpreter * InterpreterInfo::interpreter ( )
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 113 of file core/interpreter.cpp.

◆ interpreterName()

const QString InterpreterInfo::interpreterName ( ) const
the name of the interpreter. For example "python" or "ruby".

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

◆ mimeTypes()

const QStringList InterpreterInfo::mimeTypes ( ) const

List of mimetypes this interpreter supports.

QStringList with mimetypes like "application/javascript".

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

◆ option()

InterpreterInfo::Option * InterpreterInfo::option ( const QString name) const
the option defined with name .

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

◆ options()

InterpreterInfo::Option::Map & InterpreterInfo::options ( )
the reference to the intenal used map with all options.

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

◆ optionValue()

const QVariant InterpreterInfo::optionValue ( const QString name,
const QVariant defaultvalue = QVariant() 
) const
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 108 of file core/interpreter.cpp.

◆ wildcard()

const QString InterpreterInfo::wildcard ( ) const
the file-wildcard used to determinate by this interpreter used scriptingfiles. For example python just defines it as "*py".

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

The documentation for this class was generated from the following files:
unsigned int version()
The InterpreterInfo class provides abstract information about a Interpreter before the interpreter-ba...
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Tue Dec 5 2023 04:09:32 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.