A helper class to work with FILE related 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 
 | 
|  | 
|  | 
|  | thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") | 
|  | 
◆ __init__()
      
        
          | __init__ | ( |  | self, | 
        
          |  |  | * | args ) | 
      
 
- Parameters
- 
  
  
init(self, pycapsule=None) -> qfile_t
- Parameters
- 
  
  
 
 
◆ close()
      
        
          | "void" close | ( |  | self, | 
        
          |  |  | * | args ) | 
      
 
 
◆ filename()
      
        
          | "PyObject *" filename | ( |  | self, | 
        
          |  |  | * | args ) | 
      
 
 
◆ flush()
      
        
          | "int" flush | ( |  | self, | 
        
          |  |  | * | args ) | 
      
 
 
◆ from_capsule()
  
  | 
        
          | "qfile_t *" from_capsule | ( | * | args | ) |  |  | static | 
 
 
◆ from_fp()
  
  | 
        
          | "qfile_t *" from_fp | ( | * | args | ) |  |  | static | 
 
 
◆ 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
- 
  
  
 
 
◆ open()
      
        
          | "bool" open | ( |  | self, | 
        
          |  |  | * | args ) | 
      
 
- Parameters
- 
  
    | filename | the file name |  | mode | The mode string, ala fopen() style |  
 
- Returns
- : Boolean 
 
 
◆ opened()
      
        
          | "bool" opened | ( |  | self, | 
        
          |  |  | * | args ) | 
      
 
 
◆ put_byte()
      
        
          | "int" put_byte | ( |  | self, | 
        
          |  |  | * | args ) | 
      
 
 
◆ puts()
      
        
          | "int" puts | ( |  | self, | 
        
          |  |  | * | args ) | 
      
 
 
◆ read()
      
        
          | "PyObject *" read | ( |  | self, | 
        
          |  |  | * | args ) | 
      
 
Returns the buffer or None
- Parameters
- 
  
  
 
 
◆ readbytes()
      
        
          | "PyObject *" readbytes | ( |  | self, | 
        
          |  |  | * | args ) | 
      
 
 
◆ seek()
      
        
          | "int" seek | ( |  | self, | 
        
          |  |  | * | args ) | 
      
 
- Parameters
- 
  
  
- 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
- 
  
  
 
 
◆ writebytes()
      
        
          | "int" writebytes | ( |  | self, | 
        
          |  |  | * | args ) | 
      
 
- Parameters
- 
  
    | py_buf | PyObject * |  | big_endian | bool |  
 
 
 
◆ 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: