All Classes Namespaces Functions Variables Groups Pages
QC_ReadOnlyFile.dox.h
namespace Qore {
class ReadOnlyFile {
public:
int close();
public:
constructor(string path, *string encoding);
public:
copy();
public:
destructor();
public:
string getEncoding();
public:
*string getFileName();
public:
int getPos();
public:
*string getchar();
public:
hash hstat();
public:
bool isDataAvailable(timeout timeout_ms = 0);
public:
bool isOpen();
public:
bool isTty();
public:
nothing open(string path, *string encoding);
public:
*string read(softint size, timeout timeout_ms = -1);
public:
*binary readBinary(softint size, timeout timeout_ms = -1);
public:
*string readLine(bool incl_eol = True, *string eol);
public:
*int readi1();
public:
*int readi2();
public:
*int readi2LSB();
public:
*int readi4();
public:
*int readi4LSB();
public:
*int readi8();
public:
*int readi8LSB();
public:
*int readu1();
public:
*int readu2();
public:
*int readu2LSB();
public:
*int readu4();
public:
*int readu4LSB();
public:
nothing setEncoding(*string encoding);
public:
nothing setEventQueue(Qore::Thread::Queue queue);
public:
nothing setEventQueue();
public:
int setPos(int pos = 0);
public:
list stat();
public:
hash statvfs();
public:
static binary readBinaryFile(string path);
public:
static string readTextFile(string path, *string encoding);
};
const S_IFBLK = S_IFBLK;
const S_IFCHR = S_IFCHR;
const S_IFDIR = S_IFDIR;
const S_IFLNK = S_IFLNK;
const S_IFMT = S_IFMT;
const S_IFREG = S_IFREG;
const S_IFSOCK = S_IFSOCK;
const S_IFWHT = S_IFWHT;
const S_IRGRP = S_IRGRP;
const S_IROTH = S_IROTH;
const S_IRUSR = S_IRUSR;
const S_IRWXG = S_IRWXG;
const S_IRWXO = S_IRWXO;
const S_IRWXU = S_IRWXU;
const S_ISGID = S_ISGID;
const S_ISUID = S_ISUID;
const S_ISVTX = S_ISVTX;
const S_IWGRP = S_IWGRP;
const S_IWOTH = S_IWOTH;
const S_IWUSR = S_IWUSR;
const S_IXGRP = S_IXGRP;
const S_IXOTH = S_IXOTH;
const S_IXUSR = S_IXUSR;
};
Qore::ReadOnlyFile::constructor
constructor(string path, *string encoding)
Creates the ReadOnlyFile object.
Qore::ReadOnlyFile::readu4
*int readu4()
Reads a 4-byte (32 bit) unsigned integer from the file in big-endian format or NOTHING if no data can...
Qore::S_IFREG
const S_IFREG
Bit signifying if the file is a regular file.
Definition: QC_ReadOnlyFile.dox.h:693
Qore::ReadOnlyFile::readi4
*int readi4()
Reads a 4-byte (32 bit) signed integer from the file in binary big-endian format or NOTHING if no dat...
Qore::S_IRWXO
const S_IRWXO
Bitmask giving the RWX mask for other; equal to 0 on native Windows ports.
Definition: QC_ReadOnlyFile.dox.h:707
Qore::S_IFDIR
const S_IFDIR
Bit signifying if the entry is a directory.
Definition: QC_ReadOnlyFile.dox.h:687
Qore::S_IRWXU
const S_IRWXU
Bitmask giving the RWX mask for the owner.
Definition: QC_ReadOnlyFile.dox.h:709
Qore::ReadOnlyFile::hstat
hash hstat()
Returns a Stat Hash about the file&#39;s status or throws an exception if any errors occur.
Qore::ReadOnlyFile::readu2LSB
*int readu2LSB()
Reads a 2-byte (16 bit) unsigned integer from the file in binary little-endian format or NOTHING if n...
Qore::ReadOnlyFile::setPos
int setPos(int pos=0)
Sets the current file position (in bytes from the beginning of the file)
Qore::S_IFWHT
const S_IFWHT
Bitmask signifying if the file is a whiteout file; equal to 0 on native Windows ports.
Definition: QC_ReadOnlyFile.dox.h:697
Qore::True
const True
logical True
Definition: qc_qore.dox.h:94
Qore::ReadOnlyFile::copy
copy()
Creates a new ReadOnlyFile object with the same character encoding specification as the original...
Qore::ReadOnlyFile::open
nothing open(string path, *string encoding)
Opens a file in a particular mode; throws an exception on failure.
Qore::ReadOnlyFile::getEncoding
string getEncoding()
Returns the character encoding for the ReadOnlyFile.
Qore::S_IXUSR
const S_IXUSR
Bit signifying if the file&#39;s owner has execute permissions.
Definition: QC_ReadOnlyFile.dox.h:727
Qore::binary
binary binary()
Always returns an empty binary object (of zero length)
Qore::ReadOnlyFile::isOpen
bool isOpen()
returns True if the File is open, False if not
Qore::S_IWUSR
const S_IWUSR
Bit signifying if the file&#39;s owner has write permissions.
Definition: QC_ReadOnlyFile.dox.h:721
Qore::ReadOnlyFile::read
*string read(softint size, timeout timeout_ms=-1)
Reads a certain number of bytes from the ReadOnlyFile within an optional timeout period and returns a...
Qore::list
list list(...)
Returns a list of the arguments passed at the top level.
Qore::ReadOnlyFile::getFileName
*string getFileName()
returns the file path/name used to open the file if the file is open, otherwise NOTHING ...
Qore::ReadOnlyFile::close
int close()
Closes the ReadOnlyFile object.
Qore::ReadOnlyFile::getchar
*string getchar()
Reads one character from the file and returns it as a string; returns NOTHING if no data can be read ...
Qore::S_IRGRP
const S_IRGRP
Bit signifying if the file&#39;s group has read permissions; equal to 0 on native Windows ports...
Definition: QC_ReadOnlyFile.dox.h:699
Qore::ReadOnlyFile::readLine
*string readLine(bool incl_eol=True, *string eol)
Reads until an EOL marker is found and returns the string read or NOTHING if no data can be read...
Qore::ReadOnlyFile::getPos
int getPos()
Returns the current file position as an integer giving the offset in bytes from the beginning of the ...
Qore::ReadOnlyFile::statvfs
hash statvfs()
Returns a Filesystem Status Hash about the file&#39;s filesystem status or throws an exception if any err...
Qore::ReadOnlyFile::destructor
destructor()
Closes the ReadOnlyFile if it is open and destroys the ReadOnlyFile object.
Qore::ReadOnlyFile::readi1
*int readi1()
Reads a 1-byte signed integer from the file in binary format or NOTHING if no data can be read...
Qore::S_IFCHR
const S_IFCHR
Bit signifying if the file is a character special (device) file.
Definition: QC_ReadOnlyFile.dox.h:685
Qore::ReadOnlyFile::readi2LSB
*int readi2LSB()
Reads a 2-byte (16 bit) signed integer from the file in binary little-endian format or NOTHING if no ...
Qore::ReadOnlyFile::readi8
*int readi8()
Reads an 8-byte (64 bit) signed integer from the file in binary big-endian format or NOTHING if no da...
Qore::S_IROTH
const S_IROTH
Bit signifying if other has read permissions; equal to 0 on native Windows ports. ...
Definition: QC_ReadOnlyFile.dox.h:701
Qore::ReadOnlyFile::readi4LSB
*int readi4LSB()
Reads a 4-byte (32 bit) signed integer from the file in binary little-endian format or NOTHING if no ...
Qore::ReadOnlyFile::isDataAvailable
bool isDataAvailable(timeout timeout_ms=0)
Returns True if there is data available for reading from the file within the timeout period...
Qore::ReadOnlyFile::readBinaryFile
static binary readBinaryFile(string path)
returns the contents of a binary file as a binary object
Qore::S_IWOTH
const S_IWOTH
Bit signifying if other has write permissions; equal to 0 on native Windows ports.
Definition: QC_ReadOnlyFile.dox.h:719
Qore::ReadOnlyFile::stat
list stat()
Returns a Stat List about the file&#39;s status or throws an exception if any errors occur.
Qore::S_IXGRP
const S_IXGRP
Bit signifying if the file&#39;s group has execute permissions; equal to 0 on native Windows ports...
Definition: QC_ReadOnlyFile.dox.h:723
Qore::S_ISUID
const S_ISUID
Bit signifying set user id on execution; equal to 0 on native Windows ports.
Definition: QC_ReadOnlyFile.dox.h:713
Qore::S_IFLNK
const S_IFLNK
Bitmask signifying if the file is a symbolic link; equal to 0 on native Windows ports.
Definition: QC_ReadOnlyFile.dox.h:689
Qore::S_ISVTX
const S_ISVTX
Bit signifying restricted deletes for directories; equal to 0 on native Windows ports.
Definition: QC_ReadOnlyFile.dox.h:715
Qore::S_IWGRP
const S_IWGRP
Bit signifying if the file&#39;s group has write permissions; equal to 0 on native Windows ports...
Definition: QC_ReadOnlyFile.dox.h:717
Qore::S_IFMT
const S_IFMT
File type bitmask
Definition: QC_ReadOnlyFile.dox.h:691
Qore::ReadOnlyFile::readu4LSB
*int readu4LSB()
Reads a 4-byte (32 bit) unsigned integer from the file in binary little-endian format or NOTHING if n...
Qore::Thread::Queue
Queue objects provide a blocking, thread-safe message-passing object to Qore programs ...
Definition: QC_Queue.dox.h:15
Qore::ReadOnlyFile::readi2
*int readi2()
Reads a 2-byte (16 bit) signed integer from the file in binary big-endian format or NOTHING if no dat...
Qore::S_IFBLK
const S_IFBLK
Bitmask signifying if the file is a block special (device) file.
Definition: QC_ReadOnlyFile.dox.h:683
Qore::ReadOnlyFile::setEventQueue
nothing setEventQueue()
Removes any Queue object from the ReadOnlyFile object so that file events are no longer added to the ...
Qore::ReadOnlyFile::setEncoding
nothing setEncoding(*string encoding)
Sets the character encoding for the ReadOnlyFile; if called with no argument, the default encoding is...
Qore::ReadOnlyFile::readTextFile
static string readTextFile(string path, *string encoding)
returns the contents of a text file as a string optionally tagged with the given character encoding ...
Qore::S_ISGID
const S_ISGID
Bit signifying set group id on execution; equal to 0 on native Windows ports.
Definition: QC_ReadOnlyFile.dox.h:711
Qore::ReadOnlyFile::isTty
bool isTty()
returns True if the File is connected to a terminal device, False if not
Qore::ReadOnlyFile::readBinary
*binary readBinary(softint size, timeout timeout_ms=-1)
Reads a certain number of bytes from the file within an optional timeout period and returns a binary ...
Qore::S_IRWXG
const S_IRWXG
Bitmask giving the RWX mask for the group; equal to 0 on native Windows ports.
Definition: QC_ReadOnlyFile.dox.h:705
Qore::S_IFSOCK
const S_IFSOCK
Bitmask signifying if the file is a socket file; equal to 0 on native Windows ports.
Definition: QC_ReadOnlyFile.dox.h:695
Qore::hash
hash hash(object obj)
Returns a hash of an object&#39;s members.
Qore::ReadOnlyFile
The ReadOnlyFile class allows Qore programs to read existing files.
Definition: QC_ReadOnlyFile.dox.h:18
Qore::ReadOnlyFile::readu1
*int readu1()
Reads a 1-byte unsigned integer from the ReadOnlyFile in binary format or NOTHING if no data can be r...
Qore::ReadOnlyFile::readu2
*int readu2()
Reads a 2-byte (16 bit) unsigned integer from the ReadOnlyFile in binary big-endian format or NOTHING...
Qore::S_IRUSR
const S_IRUSR
Bit signifying if the file&#39;s owner has read permissions.
Definition: QC_ReadOnlyFile.dox.h:703
Qore::S_IXOTH
const S_IXOTH
Bit signifying if other has execute permissions; equal to 0 on native Windows ports.
Definition: QC_ReadOnlyFile.dox.h:725
Qore::ReadOnlyFile::readi8LSB
*int readi8LSB()
Reads an 8-byte (64 bit) signed integer from the file in binary little-endian format or NOTHING if no...