Package pyffi :: Module object_models :: Class FileFormat :: Class Data
[hide private]
[frames] | no frames]

Class Data

source code

            object --+        
                     |        
utils.graph.DetailNode --+    
                         |    
    utils.graph.GlobalNode --+
                             |
                            FileFormat.Data
Known Subclasses:

Base class for representing data in a particular format. Override this class to implement reading and writing.
Instance Methods [hide private]
 
inspect(self, stream)
Quickly checks whether the stream appears to contain data of a particular format.
source code
 
read(self, stream)
Read data of particular format from stream.
source code
 
write(self, stream)
Write data of particular format to stream.
source code

Inherited from utils.graph.GlobalNode: get_global_child_edge_types, get_global_child_nodes, get_global_display, get_global_iterator

Inherited from utils.graph.DetailNode: get_detail_child_edge_types, get_detail_child_names, get_detail_child_nodes, get_detail_display, get_detail_iterator, replace_global_node

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __init__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables [hide private]
  _byte_order = '<'
Set to '<' for little-endian, and '>' for big-endian.
  user_version = None
User version (additional version field) of the data.
  version = None
Version of the data.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

inspect(self, stream)

source code 

Quickly checks whether the stream appears to contain data of a particular format. Resets stream to original position. Call this function if you simply wish to check that a file is of a particular format without having to parse it completely.

Override this method.

Parameters:
  • stream (file) - The file to inspect.
Returns:
True if stream is of particular format, False otherwise.

read(self, stream)

source code 
Read data of particular format from stream. Override this method.
Parameters:
  • stream (file) - The file to read from.

write(self, stream)

source code 
Write data of particular format to stream. Override this method.
Parameters:
  • stream (file) - The file to write to.