IDAPython 8.4
Loading...
Searching...
No Matches
qfile_t Class Reference

A helper class to work with FILE related functions.

Inheritance diagram for qfile_t:

Public Member Functions

 __init__ (self, *args)
 init(self, rhs) -> qfile_t
 
"bool" opened (self, *args)
 opened(self) -> bool Checks if the file is opened or not
 
"void" close (self, *args)
 close(self) Closes the file
 
"bool" open (self, *args)
 open(self, filename, mode) -> bool Opens a file
 
"FILE *" get_fp (self, *args)
 get_fp(self) -> FILE *
 
"int" seek (self, *args)
 seek(self, offset, whence=SEEK_SET) -> int Set input source position
 
"int64" tell (self, *args)
 tell(self) -> int64 Returns the current position
 
"PyObject *" readbytes (self, *args)
 readbytes(self, size, big_endian) -> PyObject * Similar to read() but it respect the endianness
 
"PyObject *" read (self, *args)
 read(self, size) -> PyObject * Reads from the file.
 
"PyObject *" gets (self, *args)
 gets(self, size) -> PyObject * Reads a line from the input file.
 
"int" writebytes (self, *args)
 writebytes(self, py_buf, big_endian) -> int Similar to write() but it respect the endianness
 
"int" write (self, *args)
 write(self, py_buf) -> int Writes to the file.
 
"int" puts (self, *args)
 puts(self, str) -> int
 
"int64" size (self, *args)
 size(self) -> int64
 
"int" flush (self, *args)
 flush(self) -> int
 
"PyObject *" filename (self, *args)
 filename(self) -> PyObject *
 
"PyObject *" get_byte (self, *args)
 get_byte(self) -> PyObject * Reads a single byte from the file.
 
"int" put_byte (self, *args)
 put_byte(self, chr) -> int Writes a single byte to the file
 

Static Public Member Functions

"qfile_t *" from_fp (*args)
 from_fp(fp) -> qfile_t
 
"qfile_t *" from_capsule (*args)
 from_capsule(pycapsule) -> qfile_t
 
"qfile_t *" tmpfile (*args)
 tmpfile() -> qfile_t A static method to construct an instance using a temporary file
 

Properties

 thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
 

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
* args )
Parameters
rhsqfile_t const &

init(self, pycapsule=None) -> qfile_t

Parameters
pycapsulePyObject *

Member Function Documentation

◆ close()

"void" close ( self,
* args )

◆ filename()

"PyObject *" filename ( self,
* args )

◆ flush()

"int" flush ( self,
* args )

◆ from_capsule()

"qfile_t *" from_capsule ( * args)
static
Parameters
pycapsulePyObject *

◆ from_fp()

"qfile_t *" from_fp ( * args)
static
Parameters
fpFILE *

◆ get_byte()

"PyObject *" get_byte ( self,
* args )

Returns None if EOF or the read byte

◆ get_fp()

"FILE *" get_fp ( self,
* args )

◆ gets()

"PyObject *" gets ( self,
* args )

Returns the read line or None

Parameters
sizeint

◆ open()

"bool" open ( self,
* args )
Parameters
filenamethe file name
modeThe mode string, ala fopen() style
Returns
: Boolean

◆ opened()

"bool" opened ( self,
* args )

◆ put_byte()

"int" put_byte ( self,
* args )
Parameters
chrint

◆ puts()

"int" puts ( self,
* args )
Parameters
strchar const *

◆ read()

"PyObject *" read ( self,
* args )

Returns the buffer or None

Parameters
sizeint

◆ readbytes()

"PyObject *" readbytes ( self,
* args )
Parameters
sizeint
big_endianbool

◆ seek()

"int" seek ( self,
* args )
Parameters
offsetint64
whenceint
Returns
: the new position (not 0 as fseek!)

◆ size()

"int64" size ( self,
* args )

◆ tell()

"int64" tell ( self,
* args )

◆ tmpfile()

"qfile_t *" tmpfile ( * args)
static

◆ write()

"int" write ( self,
* args )

Returns 0 or the number of bytes written

Parameters
py_bufPyObject *

◆ writebytes()

"int" writebytes ( self,
* args )
Parameters
py_bufPyObject *
big_endianbool

Property Documentation

◆ thisown

thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag")
static

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