Script
Public Slots | Public Member Functions | Properties | Private Attributes | List of all members
File Class Reference

Interface to operating system File operations, ie open, close, read, write... More...

#include <qsUtil.h>

Inheritance diagram for File:
Inheritance graph
[legend]
Collaboration diagram for File:
Collaboration graph
[legend]

Public Slots

void open (int accessMode)
 
void close ()
 
void remove ()
 
int readByte ()
 
QString read ()
 
QString readLine ()
 
QStringList readLines ()
 
void writeByte (int byte)
 
void write (const QString &data, int length=-1)
 
void writeLine (const QString &data)
 

Public Member Functions

 File (const QString &file, QScriptContext *context)
 
 ~File ()
 
QString fileName () const
 
QString path () const
 
QString absFileName () const
 
QString baseName () const
 
QString extension () const
 
QString symLink () const
 
bool exists () const
 
bool isReadable () const
 
bool isWritable () const
 
bool isExecutable () const
 
bool isHidden () const
 
bool eof () const
 
QDateTime created () const
 
QDateTime lastModified () const
 
QDateTime lastRead () const
 
int size () const
 

Properties

QString name
 
QString path
 
QString fullName
 
QString baseName
 
QString extension
 
QString symLink
 
bool exists
 
bool readable
 
bool writable
 
bool executable
 
bool hidden
 
bool eof
 
QDateTime created
 
QDateTime lastModified
 
QDateTime lastRead
 
int size
 

Private Attributes

QFile * file
 
QScriptContext * context
 

Detailed Description

Interface to operating system File operations, ie open, close, read, write...

var file = new File( filePath );
if ( file.exists )
{
var message = "The output file \"" + file.name + "\" exists. Do you wish to overwrite it?"
var ans = MessageBox.warning(message, MessageBox.Yes, MessageBox.No);
var check = MessageBox.Yes;
if(ans != MessageBox.Yes)
return false;
}
return true;

Constructor & Destructor Documentation

File::File ( const QString &  file,
QScriptContext *  context 
)
File::~File ( )

Member Function Documentation

QString File::absFileName ( ) const
QString File::baseName ( ) const
void File::close ( )
inlineslot
QDateTime File::created ( ) const
bool File::eof ( ) const
bool File::exists ( ) const
QString File::extension ( ) const
QString File::fileName ( ) const
bool File::isExecutable ( ) const
bool File::isHidden ( ) const
bool File::isReadable ( ) const
bool File::isWritable ( ) const
QDateTime File::lastModified ( ) const
QDateTime File::lastRead ( ) const
void File::open ( int  accessMode)
slot
QString File::path ( ) const
QString File::read ( )
slot
int File::readByte ( )
slot
QString File::readLine ( )
slot
QStringList File::readLines ( )
slot
void File::remove ( )
slot
int File::size ( ) const
QString File::symLink ( ) const
void File::write ( const QString &  data,
int  length = -1 
)
slot
void File::writeByte ( int  byte)
slot
void File::writeLine ( const QString &  data)
inlineslot

Member Data Documentation

QScriptContext* File::context
private
QFile* File::file
private

Property Documentation

QString File::baseName
read
QDateTime File::created
read
bool File::eof
read
bool File::executable
read
bool File::exists
read
QString File::extension
read
QString File::fullName
read
bool File::hidden
read
QDateTime File::lastModified
read
QDateTime File::lastRead
read
QString File::name
read
QString File::path
read
bool File::readable
read
int File::size
read
QString File::symLink
read
bool File::writable
read

The documentation for this class was generated from the following file: