(self)
Actually write the interface to the output file.
Actually write the interface to the output file.
Actually write the interface to the output file .
def endFeature(self):
        "Actually write the interface to the output file."
        # C-specific
        if self.emit:
            if self.feature_not_empty:
                if self.genOpts.conventions.writeFeature(self.featureExtraProtect, self.genOpts.filename):
                    self.newline()
                    if self.genOpts.protectFeature:
                        write('#ifndef', self.featureName, file=self.outFile)
                    # If type declarations are needed by other features based on
                    # this one, it may be necessary to suppress the ExtraProtect,
                    # or move it below the 'for section...' loop.
                    if self.featureExtraProtect is not None:
                        write('#ifdef', self.featureExtraProtect, file=self.outFile)
                    self.newline()
                    write('#define', self.featureName, '1', file=self.outFile)
                    for section in self.TYPE_SECTIONS:
                        contents = self.sections[section]
                        if contents:
                            write('\n'.join(contents), file=self.outFile)
                    if self.genOpts.genFuncPointers and self.sections['commandPointer']:
                        write('\n'.join(self.sections['commandPointer']), file=self.outFile)
                        self.newline()
                    if self.sections['command']:
                        if self.genOpts.protectProto:
                            write(self.genOpts.protectProto,
                                  self.genOpts.protectProtoStr, file=self.outFile)
                        write('\n'.join(self.sections['command']), end='', file=self.outFile)
                        if self.genOpts.protectProto:
                            write('#endif', file=self.outFile)
                        else:
                            self.newline()
                    if self.featureExtraProtect is not None:
                        write('#endif /*', self.featureExtraProtect, '*/', file=self.outFile)
                    if self.genOpts.protectFeature:
                        write('#endif /*', self.featureName, '*/', file=self.outFile)
        # Finish processing in superclass
        OutputGenerator.endFeature(self)
def endFeature ( self ) : # C-specific if self . emit : if self . feature_not_empty : if self . genOpts . conventions . writeFeature ( self . featureExtraProtect , self . genOpts . filename ) : self . newline ( ) if self . genOpts . protectFeature : write ( '#ifndef' , self . featureName , file = self . outFile ) # If type declarations are needed by other features based on # this one, it may be necessary to suppress the ExtraProtect, # or move it below the 'for section...' loop. if self . featureExtraProtect is not None : write ( '#ifdef' , self . featureExtraProtect , file = self . outFile ) self . newline ( ) write ( '#define' , self . featureName , '1' , file = self . outFile ) for section in self . TYPE_SECTIONS : contents = self . sections [ section ] if contents : write ( '\n' . join ( contents ) , file = self . outFile ) if self . genOpts . genFuncPointers and self . sections [ 'commandPointer' ] : write ( '\n' . join ( self . sections [ 'commandPointer' ] ) , file = self . outFile ) self . newline ( ) if self . sections [ 'command' ] : if self . genOpts . protectProto : write ( self . genOpts . protectProto , self . genOpts . protectProtoStr , file = self . outFile ) write ( '\n' . join ( self . sections [ 'command' ] ) , end = '' , file = self . outFile ) if self . genOpts . protectProto : write ( '#endif' , file = self . outFile ) else : self . newline ( ) if self . featureExtraProtect is not None : write ( '#endif /*' , self . featureExtraProtect , '*/' , file = self . outFile ) if self . genOpts . protectFeature : write ( '#endif /*' , self . featureName , '*/' , file = self . outFile ) # Finish processing in superclass OutputGenerator . endFeature ( self )