Package gavo :: Package grammars :: Module binarygrammar :: Class BinaryRecordDef
[frames] | no frames]

Class BinaryRecordDef

source code

                   object --+            
                            |            
 base.structure.StructureBase --+        
                                |        
                   object --+   |        
                            |   |        
           base.common.Parser --+        
                                |        
base.structure.ParseableStructure --+    
                                    |    
             base.structure.Structure --+
                                        |
                                       BinaryRecordDef

A definition of a binary record.

A binary records consists of a number of binary fields, each of which is defined by a name and a format code. The format codes supported here are a subset of what python's struct module supports. The widths given below are for big, little, and packed binfmts. For native (which is the default), it depends on your platform.

* <number>s -- <number> characters making up a string * b,B -- signed and unsigned byte (8 bit) * h,H -- signed and unsigned short (16 bit) * i,I -- signed and unsigned int (32 bit) * q,Q -- signed and unsigned long (64 bit) * f,d -- float and double.

The content of this element gives the record structure in the format <name>(<code>){<whitespace><name>(<code>)} where <name> is a c-style identifier.

Nested Classes

Inherited from base.structure.StructureBase: __metaclass__

Instance Methods
 
completeElement(self, ctx) source code

Inherited from base.structure.Structure: __provides__, callCompletedCallbacks, finishElement, onElementComplete, validate

Inherited from base.structure.ParseableStructure: __init__, end_, feed, feedFrom, feedObject, getAttribute, iterEvents, start_, value_

Inherited from base.structure.StructureBase: __providedBy__, adopt, breakCircles, change, copy, getAttributes, getCopyableAttributes, getSourcePosition, iterChildren, setPosition

Inherited from base.common.Parser: feedEvent

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

Class Methods

Inherited from base.structure.StructureBase: fromStructure

Class Variables
  name_ = 'binaryRecordDef'
a sentinel for all kinds of undefined values.
  attrSeq = [<gavo.base.attrdef.EnumeratedUnicodeAttribute objec...
  managedAttrs = {'binfmt': <gavo.base.attrdef.EnumeratedUnicode...

Inherited from base.structure.Structure: __implemented__

Inherited from base.structure.StructureBase: completedCallbacks

Properties

Inherited from object: __class__

Method Details

completeElement(self, ctx)

source code 
Overrides: base.structure.Structure.completeElement

Class Variable Details

attrSeq

Value:
[<gavo.base.attrdef.EnumeratedUnicodeAttribute object>,
 <gavo.base.structure.DataContent object>,
 <gavo.base.parsecontext.IdAttribute object>]

managedAttrs

Value:
{'binfmt': <gavo.base.attrdef.EnumeratedUnicodeAttribute object>,
 'content_': <gavo.base.structure.DataContent object>,
 'id': <gavo.base.parsecontext.IdAttribute object>}