Re: [pygccxml-development] Problems with long filename
Brought to you by:
mbaas,
roman_yakovenko
|
From: Roman Y. <rom...@gm...> - 2007-03-09 14:48:42
|
On 3/9/07, Birgir Sigurjonsson <Bir...@ro...> wrote:
>
> Hei, I cannot get any of those to work, as it seems to me
> that they are based on the fact that I have declared the
> classes.
Strange, I am curious to know why
>
>
>
> I added this
> holder = mb.class_( 'std::vector < std::string >')
> holder.rename( 'StringVector' )
>
> and got this error
>
> pygccxml.declarations.matcher.declaration_not_found_t: Unable to find declaration. matcher: [(decl type==class_t) and (name==std::vector < std::string >)
>
> In my case it is the return type (stl container) that
> is beeing auto converted to a class_ by Py++
this is because the name of the class is different. First of all
you've got the class name
first time when you get IOError
Second you can find the exact name of the class in few ways:
1. for x in mb.classes( lambda cls: cls.name.startswith( 'vector<' ) ):
print x.name
2. al_cls = mb.class_( 'AbstractLoader' )
extensions = al_cls.mem_fun( 'extensions' )
rtype = extensions.return_type
print rtype
rtype_cls = declarations.class_traits.get_declaration( rtype )
rtype.alias = 'vector_of_strings'
> Is there any other way?
Not really, but the solution I described should work
--
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/
|