KSUtil Class Reference
Utility functions for checking arguments and creating exceptions. More...
#include <koscript_util.h>
Static Public Member Functions | |
bool | checkArgumentsCount (KSContext &context, uint count, const QString &method, bool fatal=true) |
bool | checkType (KSContext &context, KSValue *v, KSValue::Type t, bool fatal=true) |
bool | checkType (KSContext &context, const KSValue::Ptr &v, KSValue::Type t, bool fatal=true) |
void | castingError (KSContext &context, KSValue *v, KSValue::Type t) |
void | castingError (KSContext &context, const QString &from, const QString &to) |
void | argumentsMismatchError (KSContext &context, const QString &methodname) |
void | tooFewArgumentsError (KSContext &context, const QString &methodname) |
void | tooManyArgumentsError (KSContext &context, const QString &methodname) |
bool | checkArgs (KSContext &context, const QCString &signature, const QString &method, bool fatal=TRUE) |
bool | checkArgs (KSContext &context, const QValueList< KSValue::Ptr > &args, const QCString &signature, const QString &method, bool fatal=TRUE) |
bool | checkArg (KSContext &context, const KSValue::Ptr &arg, const QCString &signature, const QString &method="", bool fatal=FALSE) |
Detailed Description
Utility functions for checking arguments and creating exceptions.
- Author:
- Torben Weis <weis@kde.org>
Definition at line 35 of file koscript_util.h.
Member Function Documentation
|
Checks whether
Definition at line 25 of file koscript_util.cc. References tooFewArgumentsError(), and tooManyArgumentsError(). |
|
Definition at line 45 of file koscript_util.cc. References castingError(), and KSValue::implicitCast(). Referenced by checkArg(), and checkArgs(). |
|
Definition at line 59 of file koscript_util.cc. References castingError(). |
|
Creates an exception for
Definition at line 79 of file koscript_util.cc. References KSValue::typeName(). Referenced by checkArg(), checkArgs(), and checkType(). |
|
Creates an exception for
Definition at line 73 of file koscript_util.cc. |
|
Creates an exception for
Definition at line 85 of file koscript_util.cc. |
|
Creates an exception for
Definition at line 91 of file koscript_util.cc. Referenced by checkArgs(), and checkArgumentsCount(). |
|
Creates an exception for
Definition at line 97 of file koscript_util.cc. Referenced by checkArgumentsCount(). |
|
A convenience function that extracts the arguemnts out of "context.value()". It checks whether this value is really a list. Definition at line 103 of file koscript_util.cc. References checkType(). |
|
Checks whether the argument list passed in
Example: "iSqt:QRect;f|b" is a signature that takes 1) an integer 2) a struct named "QRect" in module "qt" 3) a float 4) an optional boolean Definition at line 111 of file koscript_util.cc. References castingError(), checkType(), and tooFewArgumentsError(). |
|
Checks whether the argument passed in
Example: "Sqt:QRect;" is a signature that takes a struct named "QRect" in module "qt" Definition at line 206 of file koscript_util.cc. References castingError(), and checkType(). |
The documentation for this class was generated from the following files: