koscript_util.h
00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __KSCRIPT_UTIL_H__
00021 #define __KSCRIPT_UTIL_H__
00022
00023 #include "koscript_value.h"
00024 #include <koffice_export.h>
00025
00026 #include <qrect.h>
00027
00028 class KSContext;
00029 class KSStruct;
00030
00036 class KOSCRIPT_EXPORT KSUtil
00037 {
00038 public:
00045 static bool checkArgumentsCount( KSContext& context, uint count, const QString& method, bool fatal = true );
00055 static bool checkType( KSContext& context, KSValue* v, KSValue::Type t, bool fatal = true );
00065 static bool checkType( KSContext& context, const KSValue::Ptr& v, KSValue::Type t, bool fatal = true );
00070 static void castingError( KSContext& context, KSValue* v, KSValue::Type t );
00075 static void castingError( KSContext& context, const QString& from, const QString& to );
00080 static void argumentsMismatchError( KSContext& context, const QString& methodname );
00085 static void tooFewArgumentsError( KSContext& context, const QString& methodname );
00090 static void tooManyArgumentsError( KSContext& context, const QString& methodname );
00091
00096 static bool checkArgs( KSContext& context, const QCString& signature, const QString& method, bool fatal = TRUE );
00129 static bool checkArgs( KSContext& context, const QValueList<KSValue::Ptr>& args,
00130 const QCString& signature, const QString& method, bool fatal = TRUE );
00157 static bool checkArg( KSContext& context, const KSValue::Ptr& arg,
00158 const QCString& signature, const QString& method = "", bool fatal = FALSE );
00159 };
00160
00161 #endif
This file is part of the documentation for lib Library Version 1.4.2.