Data Integrator (Python API)
Public Member Functions | List of all members
cls.DefaultTable.CDefaultTableReader Class Reference

Implements reading of TSV files. More...

Inheritance diagram for cls.DefaultTable.CDefaultTableReader:
Inheritance graph
[legend]
Collaboration diagram for cls.DefaultTable.CDefaultTableReader:
Collaboration graph
[legend]

Public Member Functions

def __init__ (s, ffn)
 Ctor. More...
 
def __iter__ (s)
 Return the iterable object, needed for for/while loops. More...
 
def next (s)
 
def IsEmpty (s, verbose=False)
 Checks if a file is empty. More...
 
def GetHeader (s, verbose=False)
 Get the first line of this file. More...
 
def GetLineNr (s)
 Get current line number. More...
 
def GetReader (s)
 
- Public Member Functions inherited from cls.DefaultTable.CDefaultTableBase
def IsValid (s)
 Check if the object is ready for reading/writing. More...
 
def Close (s)
 Close the file object associated with the file name. More...
 

Additional Inherited Members

- Static Public Attributes inherited from cls.DefaultTable.CDefaultTableBase
 COL_SEP = CSV_SEP;
 
 QUOTING = csv.QUOTE_NONE;
 
string ESCAPE_CHAR = "\\";
 

Detailed Description

Implements reading of TSV files.

Constructor & Destructor Documentation

◆ __init__()

def cls.DefaultTable.CDefaultTableReader.__init__ (   s,
  ffn 
)

Ctor.

    @param ffn  Full path file name. If it is set to '-', the standard
    input or output will be opened instead.

Reimplemented from cls.DefaultTable.CDefaultTableBase.

Reimplemented in cls.DefaultTable.CVcfTableReader.

Member Function Documentation

◆ __iter__()

def cls.DefaultTable.CDefaultTableReader.__iter__ (   s)

Return the iterable object, needed for for/while loops.

◆ GetHeader()

def cls.DefaultTable.CDefaultTableReader.GetHeader (   s,
  verbose = False 
)

Get the first line of this file.

    The caller has to decide if there is a header in the file. This method
    reads the first line of a stream and advances the file pointer to the
    next line. If the first line has already been written, it will
    nevertheless report the first line read.

    @param verbose If @c True, an error will be written if the input is
     empty and no header can be read.
    @return The columns of the first line or an empty @c List if the file
     itself is empty.

◆ GetLineNr()

def cls.DefaultTable.CDefaultTableReader.GetLineNr (   s)

Get current line number.

    @return Line number (@c int).

◆ GetReader()

def cls.DefaultTable.CDefaultTableReader.GetReader (   s)
     @return @c csv.reader instance for more sophisticated operations. Be
     aware though, that using this instance will interfere with the states
     stored in this wrapper class and may result in unanticipated outcomes.

◆ IsEmpty()

def cls.DefaultTable.CDefaultTableReader.IsEmpty (   s,
  verbose = False 
)

Checks if a file is empty.

   This method can be called at any time.
   @param verbose If @c True, a warning will be written if an empty
   file is detected. If @c False, the method will run silently.
   @return @c True if the file or stream is empty. @c False if the file
   contains some content.

◆ next()

def cls.DefaultTable.CDefaultTableReader.next (   s)
     Mirrors the iterator's next() method and does some housekeeping.

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