Re: [pygccxml-development] Problems with long filename
Brought to you by:
mbaas,
roman_yakovenko
|
From: Birgir S. <Bir...@ro...> - 2007-03-09 18:20:52
|
Hei, here is my header file.
#include <boost/utility.hpp>
#include <boost/shared_ptr.hpp>
#include <string>
#include <vector>
class AbstractLoader : private boost::noncopyable {
public:
=0D
AbstractLoader();
virtual ~AbstractLoader();
std::vector < std::string > extensions() const;
=0D
private:
virtual std::vector < std::string > extensions_impl() const =3D 0;
};
But mb.class_() does not find the class gives the following error.
pygccxml.declarations.matcher.declaration_not_found_t: Unable to find=
declaration. matcher: [(decl type=3D=3Dclass_t) and (name=3D=
=3Dstd::vector<std::basic_string<char, std::char_traits<char>,=
std::allocator<char> >,std::allocator<std::basic_string<char,=
std::char_traits<char>, std::allocator<char> > > >)]
This is printed out as the return type from the extensions function.
std::vector<std::basic_string<char, std::char_traits<char>,=
std::allocator<char> >,std::allocator<std::basic_string<char,=
std::char_traits<char>, std::allocator<char> > > >
import os
from pyplusplus import module_builder
#Creating an instance of class that will help you to expose your=
declarations
mb =3D module_builder.module_builder_t(=
['/home/birgir-s/src/abstractloader.h',
]
, gccxml_path=3Dr""=0D
, working_directory=
=3Dr"/home/birgir-s/src"
, include_paths=
=3D['/home/birgir-s/src']
, define_symbols=3D[]
)
mb.decls( lambda decl: 'impl' in decl.name ).exclude()
#mb.print_declarations()
#Creating code creator. After this step you should not modify/customize=
declarations.
mb.build_code_creator( module_name=3D'pyplusplus' )
all=3Dmb.class_('AbstractLoader')
extensions=3Dall.mem_fun('extensions')
rtype=3Dextensions.return_type
print 'extensions', rtype
#below will fail as declarations do not exist
#rtype_cls =3D declarations.class_traits.get_declaration( rtype )
#rtype.alias =3D 'vector_of_strings'
#does not print out the vector class
for m in mb.classes():
print m.name
#this will fail because of vector does not exist as a class
#holder =3D mb.class_( 'std::vector<std::basic_string<char,=
std::char_traits<char>, std::allocator<char>=
>,std::allocator<std::basic_string<char, std::char_traits<char>,=
std::allocator<char> > > >' )
#holder.rename( 'vectof_of_strings' )
#Writing code to file.
mb.write_module( './bindings.cpp')=0D
#mb.split_module('splitted')
Thanks,
Birgir.
-----Original Message-----
From: Roman Yakovenko [mailto:rom...@gm...]
Sent: Fri 3/9/2007 6:31 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 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?
>
> 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'
May I see your code that reproduce the bug? Something fundamentally
wrong or broken.
At best the example would consist from single header file and Py++ script.
Thanks
--=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 |