Changeset a1d1b90 in sasview for sansmodels


Ignore:
Timestamp:
Jan 4, 2012 2:55:44 PM (13 years ago)
Author:
Mathieu Doucet <doucetm@…>
Branches:
master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
Children:
e63a411
Parents:
43ccd258
Message:

updated wrapperGenerator

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sansmodels/src/python_wrapper/WrapperGenerator.py

    r67424cd ra1d1b90  
    6868        ## Parser in struct section 
    6969        self.inStruct = False 
     70        self.foundCPP = False 
    7071        ## Name of struct for the c object 
    7172        self.structName = None 
     
    209210                 
    210211            # Catch struct name 
     212            # C++ class definition 
     213            if line.count("class")>0: 
     214                # We are entering a class definition 
     215                self.inStruct = True 
     216                self.foundCPP = True 
     217                class_name = line.replace('}','') 
     218                class_name = class_name.replace('class','') 
     219                self.inStruct = class_name.strip() 
     220             
     221            if self.inStruct and line.count("}")>0: 
     222                # We are exiting a struct block 
     223                self.inStruct = False 
     224                 
     225            # Old-Style C struct definition 
    211226            if line.count("typedef struct")>0: 
    212227                # We are entering a struct block 
     
    352367            basename = os.path.basename(self.file) 
    353368            newline = self.replaceToken(newline,  
    354                                         "[INCLUDE_FILE]", basename)            
     369                                        "[INCLUDE_FILE]", self.file)   
     370            if self.foundCPP: 
     371                newline = self.replaceToken(newline,  
     372                                            "[C_INCLUDE_FILE]", "")   
     373                newline = self.replaceToken(newline,  
     374                                            "[CPP_INCLUDE_FILE]", "#include \"%s\"" % basename)   
     375            else:   
     376                newline = self.replaceToken(newline,  
     377                                            "[C_INCLUDE_FILE]", "#include \"%s\"" % basename)    
     378                newline = self.replaceToken(newline,  
     379                                            "[CPP_INCLUDE_FILE]", "#include \"models.hh\"")   
    355380                 
    356381            # Numerical calcs dealloc 
Note: See TracChangeset for help on using the changeset viewer.