kjsembed
fileio.cpp
Go to the documentation of this file.
39 result = KJS::jsBoolean( object->open( (QIODevice::OpenModeFlag) KJSEmbed::extractInt(exec, args, 0)));
55 result = KJS::jsNumber( (long int)object->write(KJSEmbed::extractQByteArray(exec, args, 0) + '\n') );
69 KJS::throwError(exec, KJS::TypeError, i18n("Could not open file '%1'", KJSEmbed::extractQString( exec, args, 0)));
78 return KJS::jsBoolean( QFile::copy(KJSEmbed::extractQString( exec, args, 0),KJSEmbed::extractQString( exec, args, 0) ));
82 if( QFile::copy(KJSEmbed::extractQString( exec, args, 0),KJSEmbed::extractQString( exec, args, 0) ) )
88 return KJS::jsBoolean( QFile::link(KJSEmbed::extractQString( exec, args, 0),KJSEmbed::extractQString( exec, args, 0) ));
133 return new KJSEmbed::FileIOBinding( exec, new QFile( KJSEmbed::extractQString(exec,args,0 ) ) );
static void publish(KJS::ExecState *exec, KJS::JSObject *object, const Method *methods)
Publishes an array of Methods to an object.
Definition: static_binding.cpp:60
object remove(key)
Definition: fileio.h:35
bool KJSEMBED_EXPORT extractBool(KJS::ExecState *exec, const KJS::List &args, int idx, bool defaultValue=false)
Extracts a bool from an argument list.
Definition: binding_support.cpp:149
int KJSEMBED_EXPORT extractInt(KJS::ExecState *exec, const KJS::List &args, int idx, int defaultValue=0)
Extracts an integer from an argument list.
Definition: binding_support.cpp:72
END_STATIC_OBJECT_METHOD START_STATIC_METHOD_LUT(FileIO)
Definition: fileio.cpp:107
Definition: object_binding.h:88
#define END_OBJECT_METHOD
End a variant method started by START_OBJECT_METHOD.
Definition: object_binding.h:57
#define START_OBJECT_METHOD(METHODNAME, TYPE)
A simple pointer syle method.
Definition: object_binding.h:40
QByteArray KJSEMBED_EXPORT extractQByteArray(KJS::ExecState *exec, const KJS::List &args, int idx, const QByteArray &defaultValue=QByteArray())
Extracts a QByteArray from an argument list.
Definition: binding_support.cpp:50
FileIOBinding(KJS::ExecState *exec, QFile *value)
Definition: fileio.cpp:30
if(file->open((QIODevice::OpenModeFlag) KJSEmbed::extractInt(exec, args, 0)))
Definition: fileio.cpp:64
file setAutoRemove(KJSEmbed::extractBool(exec, args, 1))
END_OBJECT_METHOD object close()
QString KJSEMBED_EXPORT extractQString(KJS::ExecState *exec, const KJS::List &args, int idx, const QString defaultValue=QString())
Extracts a QString from an argument list.
Definition: binding_support.cpp:34
JSObject * throwError(ExecState *e, ErrorType t, const QString &m)
Definition: binding_support.h:241
#define START_STATIC_OBJECT_METHOD(METHODNAME)
Definition: object_binding.h:67
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:53 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:22:53 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.