Re: [pygccxml-development] Problems with long filename
Brought to you by:
mbaas,
roman_yakovenko
From: Birgir S. <Bir...@ro...> - 2007-03-09 17:28:21
|
Hei, I have tried both method, but no success yet. 1. when printing out mb.classes() there is not class that starts with vector. 2. in the following example I get an error declarations. How do I define the declarations? =0D al_cls =3D mb.class_( 'AbstractLoader' ) extensions =3D al_cls.mem_fun( 'extensions' ) rtype =3D extensions.return_type print rtype rtype_cls =3D declarations.class_traits.get_declaration( rtype ) rtype.alias =3D 'vector_of_strings' Thanks for you help, Birgir. -----Original Message----- From: Roman Yakovenko [mailto:rom...@gm...] Sent: Fri 3/9/2007 3:48 PM To: Birgir Sigurjonsson Cc: pyg...@li... Subject: Re: [pygccxml-development] Problems with long filename =0D 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 =3D 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=3D=3Dclass_t) and (name=3D= =3Dstd::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 =3D mb.class_( 'AbstractLoader' ) extensions =3D al_cls.mem_fun( 'extensions' ) rtype =3D extensions.return_type print rtype rtype_cls =3D declarations.class_traits.get_declaration( rtype ) rtype.alias =3D 'vector_of_strings' > Is there any other way? Not really, but the solution I described should work --=0D Roman Yakovenko C++ Python language binding http://www.language-binding.net/ DISCLAIMER: This message contains information that may be privileged or confidential= and is the property of the Roxar Group. It is intended only for the person= to whom it is addressed. If you are not the intended recipient, you are= not authorised to read, print, retain, copy, disseminate, distribute, or= use this message or any part thereof. If you receive this message in= error, please notify the sender immediately and delete all copies of this= message.=0D |