Changeset 3735

Show
Ignore:
Timestamp:
05/29/08 05:07:53 (3 months ago)
Author:
cboos
Message:

0.11: emulate doxygen name mangling (patch by dirk@users.sf.net, closes #780)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • doxygenplugin/0.11/doxygentrac/doxygentrac.py

    r3550 r3735  
    7070    encoding = Option('doxygen', 'encoding', 'iso-8859-1', 
    7171      """Default encoding used by the generated documentation files.""") 
     72 
     73    default_namespace = Option('doxygen', 'default_namespace', '', 
     74      """Default namespace to search for named objects in.""") 
    7275 
    7376    SUMMARY_PAGES = """ 
     
    193196 
    194197    def get_search_results(self, req, keywords, filters): 
     198        self.log.debug("DOXYBUG: kw=%s f=%s" % (keywords, filters)) 
    195199        if not 'doxygen' in filters: 
    196200            return 
     
    203207            path = os.path.join(self.base_path, doc) 
    204208            path = os.path.join(path, self.html_output) 
     209            self.log.debug("looking in doc (%s) dir: %s:" % (doc, path)) 
    205210            if os.path.isdir(path): 
    206211                index = os.path.join(path, 'search.idx') 
     
    216221            index = os.path.join(self.base_path, self.html_output) 
    217222            index = os.path.join(index, 'search.idx') 
     223            self.log.debug("looking in doc (%s) search.idx: %s:" % (doc, index)) 
    218224            if os.path.exists(index): 
    219225                creation = os.path.getctime(index) 
     
    324330        #  - expand with enum, defs, etc. 
    325331        #  - this doesn't work well with the CREATE_SUBDIRS Doxygen option 
    326         path, link = lookup('class%s.html' % file, 'class') 
     332 
     333        # do doxygen-style name->file mapping 
     334        # this is a little different than doxygen, but I don't see another way 
     335        # way to make doxygen:Type<bool> links work, as it inserts a ' ' (or 
     336        # '_01') after/before the type name. 
     337        charmap = { '_':'__', ':':'_1', '/':'_2', '<':'_3_01', '>':'_01_4', \ 
     338                    '*':'_5', '&':'_6', '|':'_7', '.':'_8', '!':'_9', \ 
     339                    ',':'_00',' ':'_01' } 
     340        mangledfile = '' 
     341        for i in file: 
     342            if i in charmap.keys(): 
     343                mangledfile += charmap[i] 
     344            else: 
     345                mangledfile += i 
     346 
     347        path, link = lookup('class%s.html' % mangledfile, 'class') 
    327348        if not path: 
    328             path, link = lookup('struct%s.html' % file, 'struct') 
     349            path, link = lookup('struct%s.html' % mangledfile, 'struct') 
    329350        if path: 
    330351            return 'view', path, link 
     352 
     353        # Try in the default_namespace 
     354        if self.default_namespace != "": 
     355            mangledfile = self.default_namespace + '_1_1' + mangledfile 
     356            path, link = lookup('class%s.html' % mangledfile, 'class') 
     357            if not path: 
     358                path, link = lookup('struct%s.html' % mangledfile, 'struct') 
     359            if path: 
     360                return 'view', path, link 
     361 
    331362 
    332363        # Revert to search... 
  • doxygenplugin/0.11/setup.py

    r3251 r3735  
    88    description='Doxygen plugin for Trac', 
    99    keywords='trac doxygen', 
    10     version='0.11.0.1', 
     10    version='0.11.0.2dev', 
    1111    url='http://trac-hacks.org/wiki/DoxygenPlugin', 
    1212    license = """Copyright (C) 2005 Jason Parks <jparks@jparks.net>