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)
 Open the file with specific access mode. More...
 
void close ()
 Close the file. More...
 
void remove ()
 Remove the file. More...
 
int readByte ()
 Read the next char of the file. More...
 
String read ()
 Read all the file. More...
 
String readLine ()
 Read one line of the file. More...
 
StringList readLines ()
 Read each line of the file. More...
 
void writeByte (int byte)
 Write a char in the file. More...
 
void write (String &data, int length=-1)
 Write a string in the file. More...
 
void writeLine (String &data)
 Write a string in the file and go next line. More...
 

Public Member Functions

 File (String &file)
 
 ~File ()
 
String fileName ()
 
String path ()
 
String absFileName ()
 
String baseName ()
 
String extension ()
 
String symLink ()
 
bool exists ()
 
bool isReadable ()
 
bool isWritable ()
 
bool isExecutable ()
 
bool isHidden ()
 
bool eof ()
 
QDateTime created ()
 
QDateTime lastModified ()
 
QDateTime lastRead ()
 
int size ()
 

Properties

String name
 file name More...
 
String path
 file path More...
 
String fullName
 file name More...
 
String baseName
 
String extension
 file extension More...
 
String symLink
 
bool exists
 file exist More...
 
bool readable
 file readable flag More...
 
bool writable
 file writable flag More...
 
bool executable
 file executable flag More...
 
bool hidden
 file hidden flag More...
 
bool eof
 file reach end More...
 
QDateTime created
 Date when the file was created. More...
 
QDateTime lastModified
 Date when the file was modified. More...
 
QDateTime lastRead
 date when the file was readed More...
 
int size
 Size of he file. More...
 

Private Attributes

QFile * file
 

Detailed Description

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

You can use it in Script Editor only.

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 ( String &  file)
File::~File ( )

Member Function Documentation

String File::absFileName ( )
String File::baseName ( )
void File::close ( )
inlineslot

Close the file.

QDateTime File::created ( )
bool File::eof ( )
bool File::exists ( )
String File::extension ( )
String File::fileName ( )
bool File::isExecutable ( )
bool File::isHidden ( )
bool File::isReadable ( )
bool File::isWritable ( )
QDateTime File::lastModified ( )
QDateTime File::lastRead ( )
void File::open ( int  accessMode)
slot

Open the file with specific access mode.

String File::path ( )
String File::read ( )
slot

Read all the file.

int File::readByte ( )
slot

Read the next char of the file.

String File::readLine ( )
slot

Read one line of the file.

StringList File::readLines ( )
slot

Read each line of the file.

void File::remove ( )
slot

Remove the file.

int File::size ( )
String File::symLink ( )
void File::write ( String &  data,
int  length = -1 
)
slot

Write a string in the file.

void File::writeByte ( int  byte)
slot

Write a char in the file.

void File::writeLine ( String &  data)
inlineslot

Write a string in the file and go next line.

Member Data Documentation

QFile* File::file
private

Property Documentation

String File::baseName
readprivate
QDateTime File::created
readprivate

Date when the file was created.

bool File::eof
readprivate

file reach end

bool File::executable
readprivate

file executable flag

bool File::exists
readprivate

file exist

String File::extension
readprivate

file extension

String File::fullName
readprivate

file name

bool File::hidden
readprivate

file hidden flag

QDateTime File::lastModified
readprivate

Date when the file was modified.

QDateTime File::lastRead
readprivate

date when the file was readed

String File::name
readprivate

file name

String File::path
readprivate

file path

bool File::readable
readprivate

file readable flag

int File::size
readprivate

Size of he file.

String File::symLink
readprivate
bool File::writable
readprivate

file writable flag


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