Re: [pygccxml-development] declarations string, stability
Brought to you by:
mbaas,
roman_yakovenko
From: Roman Y. <rom...@gm...> - 2007-12-09 18:27:46
|
On Dec 8, 2007 10:49 PM, Gustavo Carneiro <gjc...@gm...> wrote: > On 08/12/2007, Ben Schleimer <bsc...@lu...> wrote: > > > > No, what you want is to use declarations.full_name function. > > > > Are you sure? It does not seem to include the full signature. Example, > for the methods: > > > > int get_int (const char *from_string); > > int get_int (double from_float); > > > > full_name prints: > > > > '::SomeObject::get_int' > > '::SomeObject::get_int' My mistake, I forgot about arguments > > > > You could use str(declaration). That'll print out the full signature of > the member functions. > > str(declaration) is not good because: > 1. it prints parameter names (which clearly are not part of the > signature); > 2. it adds a redundant "[member function]" description which I do not need > and am afraid might change one day; You are right > 3. I don't think there are any guarantees the string format won't change > in the future. You are right > > > > > > Otherwise, you'll probably have to write your own formatting function. > > I guess I could do it. I was just hoping pygccxml had it already, to save > me some work... :P Not in this case :-(. I think you will have to introduce your own format. I guess you should consider: * function default values * function exceptions * static or not * virtuality * access type * who knows what else May be you should take a look on "cache" functionality ( http://language-binding.net/pygccxml/apidocs/pygccxml.parser.declarations_cache-module.html ). The only problem that it has is that I don't promise to be backward compatible. This is a hard to meet requirement, so I just ask from users to clean the cache every time they upgrade pygccxml. I also found out that this cache is pretty useless, because it doesn't give the desired performance boost. I don't know what is the size of your project, but may be instead of creating some format that will describe the headers content, you will save the whole XML and next time you will compare between 2 XML files? Of course this will not work if we talk about huge projects. Another idea is to take a look on Py++. Recently I implemented functionality that allows user to manage dependencies in multi-module project with a single line of code. Take a look on next file: http://pygccxml.svn.sourceforge.net/viewvc/pygccxml/pyplusplus_dev/pyplusplus/utils/__init__.py?revision=1173&view=markup The class, you should look at, is exposed_decls_db_t. As in other cases I will not promise backward compatibility. HTH -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |