[pygccxml-commit] SF.net SVN: pygccxml:[1623] pyplusplus_dev/docs
Brought to you by:
mbaas,
roman_yakovenko
From: <rom...@us...> - 2009-01-26 20:00:23
|
Revision: 1623 http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1623&view=rev Author: roman_yakovenko Date: 2009-01-26 20:00:13 +0000 (Mon, 26 Jan 2009) Log Message: ----------- changing alias used for C++/Python and XML code blocks Modified Paths: -------------- pydsc_dev/docs/pydsc.rest pygccxml_dev/docs/design.rest pygccxml_dev/docs/history/history.rest pygccxml_dev/docs/pygccxml.rest pygccxml_dev/docs/query_interface.rest pygccxml_dev/docs/upgrade_issues.rest pyplusplus_dev/docs/comparisons/pyste.rest pyplusplus_dev/docs/documentation/architecture.rest pyplusplus_dev/docs/documentation/containers.rest pyplusplus_dev/docs/documentation/ctypes/this_and_sizeof.rest pyplusplus_dev/docs/documentation/ctypes/unions.rest pyplusplus_dev/docs/documentation/ctypes/variables.rest pyplusplus_dev/docs/documentation/doc_string.rest pyplusplus_dev/docs/documentation/functions/call_policies/as_tuple.rest pyplusplus_dev/docs/documentation/functions/call_policies/call_policies.rest pyplusplus_dev/docs/documentation/functions/call_policies/custom_call_policies.rest pyplusplus_dev/docs/documentation/functions/call_policies/return_addressof.rest pyplusplus_dev/docs/documentation/functions/call_policies/return_pointee_value.rest pyplusplus_dev/docs/documentation/functions/call_policies/return_range.rest pyplusplus_dev/docs/documentation/functions/default_args.rest pyplusplus_dev/docs/documentation/functions/make_constructor.rest pyplusplus_dev/docs/documentation/functions/overloading.rest pyplusplus_dev/docs/documentation/functions/registration_order.rest pyplusplus_dev/docs/documentation/functions/transformation/inout.rest pyplusplus_dev/docs/documentation/functions/transformation/input.rest pyplusplus_dev/docs/documentation/functions/transformation/input_c_buffer.rest pyplusplus_dev/docs/documentation/functions/transformation/input_static_array.rest pyplusplus_dev/docs/documentation/functions/transformation/modify_type.rest pyplusplus_dev/docs/documentation/functions/transformation/name_mangling.rest pyplusplus_dev/docs/documentation/functions/transformation/output.rest pyplusplus_dev/docs/documentation/functions/transformation/output_static_array.rest pyplusplus_dev/docs/documentation/functions/transformation/transfer_ownership.rest pyplusplus_dev/docs/documentation/functions/transformation/transformation.rest pyplusplus_dev/docs/documentation/how_to/absolute_relative_paths.rest pyplusplus_dev/docs/documentation/how_to/best_practices.rest pyplusplus_dev/docs/documentation/how_to/exception_translation.rest pyplusplus_dev/docs/documentation/how_to/file_name_too_long.rest pyplusplus_dev/docs/documentation/how_to/hints.rest pyplusplus_dev/docs/documentation/how_to/templates.rest pyplusplus_dev/docs/documentation/inserting_code.rest pyplusplus_dev/docs/documentation/multi_module_development.rest pyplusplus_dev/docs/documentation/properties.rest pyplusplus_dev/docs/documentation/split_module.rest pyplusplus_dev/docs/documentation/tutorials/module_builder/module_builder.rest pyplusplus_dev/docs/documentation/warnings.rest pyplusplus_dev/docs/examples/boost/boost.rest pyplusplus_dev/docs/history/history.rest pyplusplus_dev/docs/peps/dsl_challenge.rest pyplusplus_dev/docs/pyplusplus.rest pyplusplus_dev/docs/troubleshooting_guide/easy_extending_guide/easy_extending_guide.rest pyplusplus_dev/docs/troubleshooting_guide/shared_ptr/shared_ptr.rest Modified: pydsc_dev/docs/pydsc.rest =================================================================== --- pydsc_dev/docs/pydsc.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pydsc_dev/docs/pydsc.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -24,7 +24,7 @@ check all the documentation strings. My goal was simplicity + easy customization. I achieved it. Here is example of usage of pydsc: -.. code-block:: Python +.. code-block:: python import pydsc #every module that will be imported after pydsc will be checked @@ -51,7 +51,7 @@ "More complex" example: -.. code-block:: Python +.. code-block:: python import pydsc #check for spell errors only in files under "/home/roman/pygccxml" directory Modified: pygccxml_dev/docs/design.rest =================================================================== --- pygccxml_dev/docs/design.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pygccxml_dev/docs/design.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -255,13 +255,13 @@ Well, `GCC-XML`_ has few bugs, which could not be fixed from it. For example -.. code-block:: cpp +.. code-block:: c++ namespace ns1{ namespace ns2{ enum fruit{ apple, orange }; } } -.. code-block:: cpp +.. code-block:: c++ void fix_enum( ns1::ns2::fruit arg=ns1::ns2::apple ); Modified: pygccxml_dev/docs/history/history.rest =================================================================== --- pygccxml_dev/docs/history/history.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pygccxml_dev/docs/history/history.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -47,7 +47,7 @@ Description: - .. code-block:: cpp + .. code-block:: c++ void do_smth( int, ... ) @@ -322,7 +322,7 @@ 4. Now you can pass operator symbol, as a name to query functions: - .. code-block:: Python + .. code-block:: python cls = global_namespace.class_( 'my_class' ) op = cls.operator( '<' ) @@ -355,7 +355,7 @@ So for example: - .. code-block:: Python + .. code-block:: python classes = ns.decls("class") classes.decls("method") Modified: pygccxml_dev/docs/pygccxml.rest =================================================================== --- pygccxml_dev/docs/pygccxml.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pygccxml_dev/docs/pygccxml.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -51,7 +51,7 @@ Only 1 ( one ) line of code is needed: -.. code-block:: Python +.. code-block:: python #global_ns is the reference to declarations, which describes global( :: ) namespace global_ns.free_functions( "do_smth", return_type='void', arg_types=[None,'int'] ) Modified: pygccxml_dev/docs/query_interface.rest =================================================================== --- pygccxml_dev/docs/query_interface.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pygccxml_dev/docs/query_interface.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -16,7 +16,7 @@ a reference to an integer. More over, I want those functions names to end with "impl" string and they should be protected or private. -.. code-block:: Python +.. code-block:: python #global_ns is the reference to an instance of namespace_t object, that #represents global namespace @@ -28,7 +28,7 @@ yourself, looking for one or many declarations, using one or two declaration properties. For example: -.. code-block:: Python +.. code-block:: python global_ns.namespaces( 'details' ) @@ -56,7 +56,7 @@ The usage of other methods is very similar to them. Here is definition of those methods: -.. code-block:: Python +.. code-block:: python def member_function( self, name=None, @@ -88,7 +88,7 @@ Python string, that contains member function name or full name. - .. code-block:: Python + .. code-block:: python do_smth = my_class.member_function( 'do_smth' ) do_smth = my_class.member_function( 'my_namespace::my_class::do_smth' ) @@ -99,7 +99,7 @@ build custom query. This object will be called with one argument - declaration, and it should return ``True`` or ``False``. - .. code-block:: Python + .. code-block:: python impls = my_class.member_functions( lambda decl: decl.name.endswith( 'impl' ) ) @@ -111,7 +111,7 @@ the function return type. This argument can be string or an object that describes C++ type. - .. code-block:: Python + .. code-block:: python mem_funcs = my_class.member_functions( return_type='int' ) @@ -128,7 +128,7 @@ to skip some argument type from within comparison, you put ``None``, into relevant position within the list. - .. code-block:: Python + .. code-block:: python mem_funcs = my_class.member_functions( arg_types=[ None, 'int'] ) @@ -190,14 +190,14 @@ In order to help `Boost.Python`_ to manage objects life time, all functions should have `call policies`_. For example: -.. code-block:: cpp +.. code-block:: c++ struct A{ A* clone() const { return new A(); } ... }; -.. code-block:: cpp +.. code-block:: c++ struct B{ B* clone() const { return new B(); } @@ -208,7 +208,7 @@ The following code applies the `call policies`_ on all ``clone`` member functions within the project: -.. code-block:: Python +.. code-block:: python #global_ns - instance of namespace_t class, that contains reference to global namespace clone = global_ns.member_functions( 'clone' ) @@ -219,7 +219,7 @@ exclude declaration, from being exported to Python. The following code will exclude ``clone`` member function from being exported: -.. code-block:: Python +.. code-block:: python global_ns.member_functions( 'clone' ).exclude() @@ -228,7 +228,7 @@ write loops, ``mdecl_wrapper_t`` class implements ``__len__``, ``__getitem__`` and ``__iter__`` methods. So you can write the following code: -.. code-block:: Python +.. code-block:: python for clone in global_ns.member_functions( 'clone' ): print clone.parent.name Modified: pygccxml_dev/docs/upgrade_issues.rest =================================================================== --- pygccxml_dev/docs/upgrade_issues.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pygccxml_dev/docs/upgrade_issues.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -37,7 +37,7 @@ C++ code: -.. code-block:: cpp +.. code-block:: c++ struct xyz_t{ int do_smth( double ); @@ -50,7 +50,7 @@ GCC-XML 0.7: -.. code-block:: XML +.. code-block:: xml <Typedef id="_6" name="mfun_ptr_t" type="_5" /> <PointerType id="_5" type="_128" size="32" align="32"/> @@ -64,7 +64,7 @@ GCC-XML 0.9: -.. code-block:: XML +.. code-block:: xml <Typedef id="_97" name="mfun_ptr_t" type="_96" /> <PointerType id="_96" type="_147" size="32" align="32"/> @@ -85,7 +85,7 @@ For example: -.. code-block:: cpp +.. code-block:: c++ const long unsigned int initialized = 10122004; @@ -102,100 +102,100 @@ fixes some issues, but introduces another ones. Take a look on the following examples: * - .. code-block:: cpp + .. code-block:: c++ void fix_numeric( ull arg=(ull)-1 ); GCC-XML 0.7 - .. code-block:: XML + .. code-block:: xml <Argument name="arg" type="_7" default="0xffffffffffffffff"/> GCC-XML 0.9 - .. code-block:: XML + .. code-block:: xml <Argument name="arg" type="_103" default="0xffffffffffffffffu"/> * - .. code-block:: cpp + .. code-block:: c++ void fix_function_call( int i=calc( 1,2,3) ); GCC-XML 0.7 - .. code-block:: XML + .. code-block:: xml <Argument name="i" type="_9" default="function_call::calc(int, int, int)(1, 2, 3)"/> GCC-XML 0.9 - .. code-block:: XML + .. code-block:: xml <Argument name="i" type="_34" default="function_call::calc(1, 2, 3)"/> * - .. code-block:: cpp + .. code-block:: c++ void typedef__func( const typedef_::alias& position = typedef_::alias() ); GCC-XML 0.7 - .. code-block:: XML + .. code-block:: xml <Argument name="position" type="_1458" default="alias()"/> GCC-XML 0.9 - .. code-block:: XML + .. code-block:: xml <Argument name="position" type="_1703" default="typedef_::original_name()"/> * - .. code-block:: cpp + .. code-block:: c++ void typedef__func2( const typedef_::alias& position = alias() ); GCC-XML 0.7 - .. code-block:: XML + .. code-block:: xml <Argument name="position" type="_1458" default="alias()"/> GCC-XML 0.9 - .. code-block:: XML + .. code-block:: xml <Argument name="position" type="_1703" default="typedef_::original_name()"/> * - .. code-block:: cpp + .. code-block:: c++ node* clone_tree( const std::vector<std::string> &types=std::vector<std::string>() ); GCC-XML 0.7 - .. code-block:: XML + .. code-block:: xml <Argument name="types" type="_3336" default="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> > > >((&allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >()))"/> GCC-XML 0.9 - .. code-block:: XML + .. code-block:: xml <Argument name="types" type="_3096" default="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> > > >(((const std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >&)((const std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >*)(& std::allocator<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >()))))"/> Basically `pygccxml`_ can't help you here. The good news is that you always can change the default value expression from the script: -.. code-block:: Python +.. code-block:: python #f is "calldef_t" instance for arg in f.arguments: @@ -211,7 +211,7 @@ Consider the following C++ code: -.. code-block:: cpp +.. code-block:: c++ template< unsigned long i1> struct item_t{ Modified: pyplusplus_dev/docs/comparisons/pyste.rest =================================================================== --- pyplusplus_dev/docs/comparisons/pyste.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pyplusplus_dev/docs/comparisons/pyste.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -186,15 +186,15 @@ * code creator that generates body of "overridden" virtual functions: - .. code-block:: cpp + .. code-block:: c++ struct expensive_to_copy{...}; - .. code-block:: cpp + .. code-block:: c++ void do_smth( expensive_to_copy* x, const expensive_to_copy& y ){...} - .. code-block:: cpp + .. code-block:: c++ void do_smth(expensive_to_copy* x, const expensive_to_copy& y){ @@ -332,7 +332,7 @@ * To define namespace alias. - .. code-block:: cpp + .. code-block:: c++ namespace dt = boost::date_time; @@ -341,7 +341,7 @@ * Classes and functions support 2 modes of code generation. Example: - .. code-block:: cpp + .. code-block:: c++ struct world{ void set(std::string msg) { this->msg = msg; } @@ -351,7 +351,7 @@ First mode: - .. code-block:: cpp + .. code-block:: c++ class_<world>("world") .def("greet", &world::greet) @@ -361,7 +361,7 @@ Second mode: - .. code-block:: cpp + .. code-block:: c++ if( true ){ typedef class_<world> world_exposer_t; Modified: pyplusplus_dev/docs/documentation/architecture.rest =================================================================== --- pyplusplus_dev/docs/documentation/architecture.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pyplusplus_dev/docs/documentation/architecture.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -85,7 +85,7 @@ Before I explain how these services are integrated, take a look on the following source code: -.. code-block:: Python +.. code-block:: python mb = module_builder_t( ... ) @@ -225,7 +225,7 @@ Here is "cut & paste" of the relevant code from the source file: - .. code-block:: Python + .. code-block:: python def _create_impl(self): result = [] Modified: pyplusplus_dev/docs/documentation/containers.rest =================================================================== --- pyplusplus_dev/docs/documentation/containers.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pyplusplus_dev/docs/documentation/containers.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -80,7 +80,7 @@ indexing suite version 2, you should tell this to the ``module_builder_t.__init__`` method: -.. code-block:: Python +.. code-block:: python mb = module_builder_t( ..., indexing_suite_version=2 ) @@ -125,7 +125,7 @@ In this case there is no single place, where you can configure exported container functionality. Please take a look on the following C++ code: -.. code-block:: cpp +.. code-block:: c++ struct item{ ... Modified: pyplusplus_dev/docs/documentation/ctypes/this_and_sizeof.rest =================================================================== --- pyplusplus_dev/docs/documentation/ctypes/this_and_sizeof.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pyplusplus_dev/docs/documentation/ctypes/this_and_sizeof.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -15,7 +15,7 @@ Example ------- - .. code-block:: Python + .. code-block:: python mb = module_builder_t( ... ) cls = mb.class_( <<<your class>>> ) @@ -25,7 +25,7 @@ The `Python`_ class will contain two properties ``this`` and ``sizeof``. The usage is pretty simple: - .. code-block:: Python + .. code-block:: python import ctypes from <<<your module>>> import <<<your class>>> as data_t Modified: pyplusplus_dev/docs/documentation/ctypes/unions.rest =================================================================== --- pyplusplus_dev/docs/documentation/ctypes/unions.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pyplusplus_dev/docs/documentation/ctypes/unions.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -22,7 +22,7 @@ For this example I am going to use the following code: - .. code-block:: cpp + .. code-block:: c++ struct data_t{ union actual_data_t{ @@ -34,7 +34,7 @@ As in many other cases, `Py++`_ does the job automatically: - .. code-block:: Python + .. code-block:: python mb = module_builder_t( ... ) mb.class_( 'data_t' ).include() @@ -44,7 +44,7 @@ The generated code is boring, so I will skip it and will continue to the usage example: - .. code-block:: Python + .. code-block:: python import ctypes from <<<your module>>> import data_t Modified: pyplusplus_dev/docs/documentation/ctypes/variables.rest =================================================================== --- pyplusplus_dev/docs/documentation/ctypes/variables.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pyplusplus_dev/docs/documentation/ctypes/variables.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -21,7 +21,7 @@ Lets say you have the following C++ code: - .. code-block:: cpp + .. code-block:: c++ struct bytes_t{ bytes_t(){ @@ -41,7 +41,7 @@ In order to get access to the ``bytes_t::data`` and ``bytes_t::x`` you have to turn on ``expose_address`` property to ``True``: - .. code-block:: Python + .. code-block:: python mb = module_builder_t( ... ) bytes = mb.class_( 'bytes_t' ) @@ -51,7 +51,7 @@ and now it is a time to show some `ctypes`_ magic: - .. code-block:: Python + .. code-block:: python import ctypes import your_module as m Modified: pyplusplus_dev/docs/documentation/doc_string.rest =================================================================== --- pyplusplus_dev/docs/documentation/doc_string.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pyplusplus_dev/docs/documentation/doc_string.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -15,7 +15,7 @@ API description --------------- -.. code-block:: Python +.. code-block:: python mb = module_builder_t( ... ) my_class = mb.class_( 'my_class' ) @@ -37,7 +37,7 @@ ``doc_extractor`` is a callable object, which takes one argument - reference to declaration. -.. code-block:: Python +.. code-block:: python def doc_extractor( decl ): ... Modified: pyplusplus_dev/docs/documentation/functions/call_policies/as_tuple.rest =================================================================== --- pyplusplus_dev/docs/documentation/functions/call_policies/as_tuple.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pyplusplus_dev/docs/documentation/functions/call_policies/as_tuple.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -16,7 +16,7 @@ Example ------- -.. code-block:: cpp +.. code-block:: c++ struct vector3{ ... @@ -65,7 +65,7 @@ The `Py++`_ code is slightly different from the C++ one, but it is definitely shorter: -.. code-block:: Python +.. code-block:: python from pyplusplus import module_builder from pyplusplus.module_builder import call_policies Modified: pyplusplus_dev/docs/documentation/functions/call_policies/call_policies.rest =================================================================== --- pyplusplus_dev/docs/documentation/functions/call_policies/call_policies.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pyplusplus_dev/docs/documentation/functions/call_policies/call_policies.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -21,13 +21,13 @@ The call policies in `Py++`_ are named exactly as in `Boost.Python`_, only the syntax is slightly different. For instance, this call policy: -.. code-block:: cpp +.. code-block:: c++ return_internal_reference< 1, with_custodian_and_ward<1, 2> >() becomes in `Py++`_ -.. code-block:: Python +.. code-block:: python return_internal_reference( 1, with_custodian_and_ward(1, 2) ) @@ -41,7 +41,7 @@ C++ code: - .. code-block:: cpp + .. code-block:: c++ struct data{...}; const data& do_smth( const data& d, int x ); @@ -53,7 +53,7 @@ Python code: - .. code-block:: Python + .. code-block:: python from pyplusplus import module_builder from pyplusplus.module_builder import call_policies @@ -130,7 +130,7 @@ * `Py++`_ generates code with - .. code-block:: cpp + .. code-block:: c++ /* undefined call policies */ @@ -157,7 +157,7 @@ Example: -.. code-block:: cpp +.. code-block:: c++ struct identity_impl_t{}; typedef identity_impl_t* identity; @@ -173,7 +173,7 @@ `Py++`_ code: -.. code-block:: Python +.. code-block:: python mb = module_builder_t(...) mb.class_( 'identity_impl_t' ).opaque = True Modified: pyplusplus_dev/docs/documentation/functions/call_policies/custom_call_policies.rest =================================================================== --- pyplusplus_dev/docs/documentation/functions/call_policies/custom_call_policies.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pyplusplus_dev/docs/documentation/functions/call_policies/custom_call_policies.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -15,7 +15,7 @@ Example ------- -.. code-block:: Python +.. code-block:: python from pyplusplus import module_builder from pyplusplus.module_builder import call_policies @@ -26,7 +26,7 @@ Optionally you can specify name of the header file, which should be included: -.. code-block:: Python +.. code-block:: python mb.free_function( ... ).call_policies \ = call_policies.custom_call_policies( <<<your call policies code>>>, "xyz.hpp" ) Modified: pyplusplus_dev/docs/documentation/functions/call_policies/return_addressof.rest =================================================================== --- pyplusplus_dev/docs/documentation/functions/call_policies/return_addressof.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pyplusplus_dev/docs/documentation/functions/call_policies/return_addressof.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -21,7 +21,7 @@ Example ------- -.. code-block:: cpp +.. code-block:: c++ int* get_value(){ static int buffer[] = { 0,1,2,3,4 }; @@ -36,7 +36,7 @@ The `Py++`_ code is not that different from what you already know: -.. code-block:: Python +.. code-block:: python from pyplusplus import module_builder from pyplusplus.module_builder import call_policies @@ -47,7 +47,7 @@ Python code: -.. code-block:: Python +.. code-block:: python import ctypes import my_module Modified: pyplusplus_dev/docs/documentation/functions/call_policies/return_pointee_value.rest =================================================================== --- pyplusplus_dev/docs/documentation/functions/call_policies/return_pointee_value.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pyplusplus_dev/docs/documentation/functions/call_policies/return_pointee_value.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -12,7 +12,7 @@ can be used to wrap C++ functions, that return a pointer to a C++ object. The policy implements the following logic: -.. code-block:: cpp +.. code-block:: c++ if( <<<return value is NULL pointer>>> ){ return None; @@ -46,7 +46,7 @@ This technique and example was contributed by Maximilian Matthe. -.. code-block:: cpp +.. code-block:: c++ struct int_wrapper{ int_wrapper(int v) @@ -83,7 +83,7 @@ Python code: -.. code-block:: Python +.. code-block:: python import my_module @@ -93,7 +93,7 @@ Return pointee value -------------------- -.. code-block:: cpp +.. code-block:: c++ float* get_value(){ static float value = 0.5; @@ -115,7 +115,7 @@ The `Py++`_ code is not that different from what you already know: -.. code-block:: Python +.. code-block:: python from pyplusplus import module_builder from pyplusplus.module_builder import call_policies @@ -126,7 +126,7 @@ Python code: -.. code-block:: Python +.. code-block:: python import my_module Modified: pyplusplus_dev/docs/documentation/functions/call_policies/return_range.rest =================================================================== --- pyplusplus_dev/docs/documentation/functions/call_policies/return_range.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pyplusplus_dev/docs/documentation/functions/call_policies/return_range.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -18,7 +18,7 @@ Example ------- -.. code-block:: cpp +.. code-block:: c++ struct image_t{ @@ -49,7 +49,7 @@ ``return_range`` class ---------------------- -.. code-block:: cpp +.. code-block:: c++ template < typename TGetSize , typename TValueType @@ -80,7 +80,7 @@ * call operator with the following signature: - .. code-block:: cpp + .. code-block:: c++ ssize_t operator()( boost::python::tuple args ); @@ -91,7 +91,7 @@ For our case, the following class could be defined: -.. code-block:: cpp +.. code-block:: c++ struct image_data_size_t{ ssize_t operator()( boost::python::tuple args ){ @@ -105,7 +105,7 @@ Passing all arguments, instead of single "self" argument gives you an ability to treat functions, where the user asked to get access to the part of the array. -.. code-block:: cpp +.. code-block:: c++ struct image_t{ ... @@ -119,7 +119,7 @@ The following "get size" class treats this situation: -.. code-block:: cpp +.. code-block:: c++ struct image_data_size_t{ ssize_t operator()( boost::python::tuple args ){ @@ -151,7 +151,7 @@ I think, now you are ready to see the whole solution: -.. code-block:: cpp +.. code-block:: c++ namespace bpl = boost::python; namespace ppc = pyplusplus::call_policies; @@ -168,7 +168,7 @@ The `Py++`_ code is not that different from what you already know: -.. code-block:: Python +.. code-block:: python from pyplusplus import module_builder from pyplusplus.module_builder import call_policies @@ -206,7 +206,7 @@ Python usage code: -.. code-block:: Python +.. code-block:: python from my_module import * Modified: pyplusplus_dev/docs/documentation/functions/default_args.rest =================================================================== --- pyplusplus_dev/docs/documentation/functions/default_args.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pyplusplus_dev/docs/documentation/functions/default_args.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -11,7 +11,7 @@ There is more than one way to export function with default arguments. Before we proceed, please take a look on the following class: -.. code-block:: cpp +.. code-block:: c++ struct X { @@ -27,7 +27,7 @@ By default `Py++`_ exposes function with its default arguments. -.. code-block:: cpp +.. code-block:: c++ namespace bp = boost::python; @@ -42,7 +42,7 @@ The additional value of the approach is keyword arguments. You will be able to call function ``f`` like this: -.. code-block:: Python +.. code-block:: python x = X() x.f( a=13 ) @@ -55,7 +55,7 @@ macros can help to deal with default values too. You can turn ``use_overload_macro`` to ``True``: -.. code-block:: Python +.. code-block:: python import module_builder @@ -71,7 +71,7 @@ There is different trades-off between these approaches. In general you should use the first one, until you have "registration order" problem: -.. code-block:: cpp +.. code-block:: c++ struct S1; struct S2; @@ -101,7 +101,7 @@ `Py++`_ doesn't have enough information to generate code with the right class registration order. In this case you have to instruct `Py++`_ to use macros: -.. code-block:: Python +.. code-block:: python import module_builder @@ -122,7 +122,7 @@ Class constructors are special case: -.. code-block:: cpp +.. code-block:: c++ struct S1; struct S2; Modified: pyplusplus_dev/docs/documentation/functions/make_constructor.rest =================================================================== --- pyplusplus_dev/docs/documentation/functions/make_constructor.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pyplusplus_dev/docs/documentation/functions/make_constructor.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -19,7 +19,7 @@ ------------- I am going to use the following code to demonstrate the functionality: -.. code-block:: cpp +.. code-block:: c++ #include <memory> @@ -41,7 +41,7 @@ `Py++`_ configuration is pretty simple: -.. code-block:: Python +.. code-block:: python from pyplusplus import module_builder @@ -62,7 +62,7 @@ The usage code is even more boring: -.. code-block:: Python +.. code-block:: python from your_module import number_t Modified: pyplusplus_dev/docs/documentation/functions/overloading.rest =================================================================== --- pyplusplus_dev/docs/documentation/functions/overloading.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pyplusplus_dev/docs/documentation/functions/overloading.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -13,7 +13,7 @@ want to export, by specifying its type. Before we proceed, please take a look on the following class: -.. code-block:: cpp +.. code-block:: c++ struct X { @@ -46,7 +46,7 @@ I am sure you will like "do nothing" approach. `Py++`_ recognize that you want to export an overloaded function and will generate the right code: -.. code-block:: cpp +.. code-block:: c++ namespace bp = boost::python; @@ -82,7 +82,7 @@ It is very important to understand it. Lets take a look on the following source code: -.. code-block:: cpp +.. code-block:: c++ struct Y{ @@ -99,7 +99,7 @@ code will not compile. You have to instruct `Py++`_ to generate code, which contains function type: -.. code-block:: Python +.. code-block:: python from pyplusplus import module_builder @@ -126,7 +126,7 @@ Consider to explicitly set ``create_with_signature`` to ``True``. It will save your and your users time in future. -.. code-block:: Python +.. code-block:: python mb = module_builder_t( ... ) mb.calldefs().create_with_signature = True @@ -149,7 +149,7 @@ You can instruct `Py++`_ to generate code, which will use the macros: -.. code-block:: Python +.. code-block:: python import module_builder Modified: pyplusplus_dev/docs/documentation/functions/registration_order.rest =================================================================== --- pyplusplus_dev/docs/documentation/functions/registration_order.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pyplusplus_dev/docs/documentation/functions/registration_order.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -22,7 +22,7 @@ Example ------- -.. code-block:: cpp +.. code-block:: c++ struct tester_t{ tester_t() {} @@ -43,7 +43,7 @@ `Py++`_ generates code, that register functions in the order they appear in the source code: -.. code-block:: cpp +.. code-block:: c++ namespace bp = boost::python; @@ -66,7 +66,7 @@ Do you want to guess what is the output of the following program: -.. code-block:: Python +.. code-block:: python import my_module tester = my_module.tester_t() @@ -97,7 +97,7 @@ 1. You can change alias of the function, by mangling the type of the argument into it: - .. code-block:: Python + .. code-block:: python mb = module_builder_t( ... ) for f in mb.class_( 'tester_t' ).member_functions(): @@ -108,7 +108,7 @@ 3. You can ask `Py++`_ to generate code, which takes into account the order of declarations: - .. code-block:: Python + .. code-block:: python from pyplusplus.creators_factory import sort_algorithms @@ -120,7 +120,7 @@ this you can change the aliases of the functions. The third step is to create small "dispatch" function in Python: - .. code-block:: Python + .. code-block:: python import my_module Modified: pyplusplus_dev/docs/documentation/functions/transformation/inout.rest =================================================================== --- pyplusplus_dev/docs/documentation/functions/transformation/inout.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pyplusplus_dev/docs/documentation/functions/transformation/inout.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -24,7 +24,7 @@ Example ------- -.. code-block:: cpp +.. code-block:: c++ #include <string> @@ -36,7 +36,7 @@ ``std::string`` is mapped to `Python`_ string, which is immutable type, so you have to create small wrapper for the function. The following `Py++`_ code does it for you: - .. code-block:: Python + .. code-block:: python from pyplusplus import module_builder from pyplusplus import function_transformers as FT @@ -47,7 +47,7 @@ What you see below is the relevant pieces of generated code: - .. code-block:: cpp + .. code-block:: c++ namespace bp = boost::python; Modified: pyplusplus_dev/docs/documentation/functions/transformation/input.rest =================================================================== --- pyplusplus_dev/docs/documentation/functions/transformation/input.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pyplusplus_dev/docs/documentation/functions/transformation/input.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -18,7 +18,7 @@ Example ------- -.. code-block:: cpp +.. code-block:: c++ #include <string> @@ -30,7 +30,7 @@ ``std::string`` is mapped to `Python`_ string, which is immutable type, so you have to create small wrapper for the function. The following `Py++`_ code does it for you: - .. code-block:: Python + .. code-block:: python from pyplusplus import module_builder from pyplusplus import function_transformers as FT @@ -41,7 +41,7 @@ What you see below is the relevant pieces of generated code: - .. code-block:: cpp + .. code-block:: c++ namespace bp = boost::python; Modified: pyplusplus_dev/docs/documentation/functions/transformation/input_c_buffer.rest =================================================================== --- pyplusplus_dev/docs/documentation/functions/transformation/input_c_buffer.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pyplusplus_dev/docs/documentation/functions/transformation/input_c_buffer.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -20,7 +20,7 @@ Example ------- -.. code-block:: cpp +.. code-block:: c++ struct file_t{ void write( char* buffer, int size ) const; @@ -29,7 +29,7 @@ In order to expose ``write`` member function we need to create small wrapper. The following `Py++`_ code does it for you: - .. code-block:: Python + .. code-block:: python from pyplusplus import module_builder from pyplusplus import function_transformers as FT @@ -40,7 +40,7 @@ What you see below is the relevant pieces of generated code: - .. code-block:: cpp + .. code-block:: c++ #include "__convenience.pypp.hpp" //Py++ header file, which contains few convenience function Modified: pyplusplus_dev/docs/documentation/functions/transformation/input_static_array.rest =================================================================== --- pyplusplus_dev/docs/documentation/functions/transformation/input_static_array.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pyplusplus_dev/docs/documentation/functions/transformation/input_static_array.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -20,7 +20,7 @@ Example ------- -.. code-block:: cpp +.. code-block:: c++ struct vector3{ @@ -36,7 +36,7 @@ In order to expose ``init`` member function we need to create small wrapper: The following `Py++`_ code does it for you: - .. code-block:: Python + .. code-block:: python from pyplusplus import module_builder from pyplusplus import function_transformers as FT @@ -47,7 +47,7 @@ What you see below is the relevant pieces of generated code: - .. code-block:: cpp + .. code-block:: c++ #include "__convenience.pypp.hpp" //Py++ header file, which contains few convenience function Modified: pyplusplus_dev/docs/documentation/functions/transformation/modify_type.rest =================================================================== --- pyplusplus_dev/docs/documentation/functions/transformation/modify_type.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pyplusplus_dev/docs/documentation/functions/transformation/modify_type.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -28,7 +28,7 @@ Example ------- -.. code-block:: cpp +.. code-block:: c++ #include <string> @@ -40,7 +40,7 @@ ``std::string`` is mapped to `Python`_ string, which is immutable type, so you have to create small wrapper for the function. The following `Py++`_ code does it for you: - .. code-block:: Python + .. code-block:: python from pygccxml import declarations from pyplusplus import module_builder @@ -52,7 +52,7 @@ What you see below is the relevant pieces of generated code: - .. code-block:: cpp + .. code-block:: c++ namespace bp = boost::python; Modified: pyplusplus_dev/docs/documentation/functions/transformation/name_mangling.rest =================================================================== --- pyplusplus_dev/docs/documentation/functions/transformation/name_mangling.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pyplusplus_dev/docs/documentation/functions/transformation/name_mangling.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -20,7 +20,7 @@ name mangling to create function-wrappers for overloaded and\\or free functions. Consider the following use case: - .. code-block:: cpp + .. code-block:: c++ void get_distance( long& ); void get_distance( double& ); @@ -28,7 +28,7 @@ In order to expose ``get_distance`` functions you have to create 2 function wrappers: - .. code-block:: cpp + .. code-block:: c++ long get_distance_as_long(){...} double get_distance_as_double(){...} @@ -37,7 +37,7 @@ on return type only. You also have to exposes them under different aliases, otherwise they will not be callable from `Python`_: - .. code-block:: cpp + .. code-block:: c++ namespace bp = boost::python; BOOST_PYTHON_MODULE(...){ @@ -64,7 +64,7 @@ If you are exposing an overloaded function, in that case `Py++`_ uses the ugly function-wrapper name as an alias. It is up to you to change the alias: - .. code-block:: Python + .. code-block:: python from pyplusplus import module_builder from pyplusplus import function_transformers as FT Modified: pyplusplus_dev/docs/documentation/functions/transformation/output.rest =================================================================== --- pyplusplus_dev/docs/documentation/functions/transformation/output.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pyplusplus_dev/docs/documentation/functions/transformation/output.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -20,7 +20,7 @@ Example ------- -.. code-block:: cpp +.. code-block:: c++ #include <string> @@ -32,7 +32,7 @@ ``std::string`` is mapped to `Python`_ string, which is immutable type, so you have to create small wrapper for the function. The following `Py++`_ code does it for you: - .. code-block:: Python + .. code-block:: python from pyplusplus import module_builder from pyplusplus import function_transformers as FT @@ -43,7 +43,7 @@ What you see below is the relevant pieces of generated code: - .. code-block:: cpp + .. code-block:: c++ namespace bp = boost::python; Modified: pyplusplus_dev/docs/documentation/functions/transformation/output_static_array.rest =================================================================== --- pyplusplus_dev/docs/documentation/functions/transformation/output_static_array.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pyplusplus_dev/docs/documentation/functions/transformation/output_static_array.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -19,7 +19,7 @@ Example ------- -.. code-block:: cpp +.. code-block:: c++ struct vector3{ @@ -35,7 +35,7 @@ In order to expose ``get_values`` member function we need to create small wrapper. The following `Py++`_ code does it for you: - .. code-block:: Python + .. code-block:: python from pyplusplus import module_builder from pyplusplus import function_transformers as FT @@ -46,7 +46,7 @@ What you see below is the relevant pieces of generated code: - .. code-block:: cpp + .. code-block:: c++ #include "__convenience.pypp.hpp" //Py++ header file, which contains few convenience function Modified: pyplusplus_dev/docs/documentation/functions/transformation/transfer_ownership.rest =================================================================== --- pyplusplus_dev/docs/documentation/functions/transformation/transfer_ownership.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pyplusplus_dev/docs/documentation/functions/transformation/transfer_ownership.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -24,7 +24,7 @@ Example ------- -.. code-block:: cpp +.. code-block:: c++ struct resource_t{...}; @@ -36,7 +36,7 @@ have to create small wrapper, which will take ``std::auto_ptr`` as an argument. The following `Py++`_ code does it for you: - .. code-block:: Python + .. code-block:: python from pygccxml import declarations from pyplusplus import module_builder @@ -51,7 +51,7 @@ What you see below is the relevant pieces of generated code: - .. code-block:: cpp + .. code-block:: c++ namespace bp = boost::python; Modified: pyplusplus_dev/docs/documentation/functions/transformation/transformation.rest =================================================================== --- pyplusplus_dev/docs/documentation/functions/transformation/transformation.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pyplusplus_dev/docs/documentation/functions/transformation/transformation.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -15,7 +15,7 @@ An often mentioned example that demonstrates the problem is the ``get_size()`` member function of a fictitious image class: -.. code-block:: cpp +.. code-block:: c++ void get_size(int& width, int& height); @@ -25,13 +25,13 @@ way to expose this function to `Python`_ is to create small wrapper, which will return a tuple. In `Python`_, the above function would instead be invoked like this: -.. code-block:: Python +.. code-block:: python width, height = img.get_size() and the wrapper could look like this: -.. code-block:: cpp +.. code-block:: c++ boost::python::tuple get_size( const image_t& img ){ int width; @@ -57,7 +57,7 @@ to provide the semantics of an argument(s) and then it will take care of producing the correct code: -.. code-block:: Python +.. code-block:: python from pyplusplus import module_builder from pyplusplus import function_transformers as FT Modified: pyplusplus_dev/docs/documentation/how_to/absolute_relative_paths.rest =================================================================== --- pyplusplus_dev/docs/documentation/how_to/absolute_relative_paths.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pyplusplus_dev/docs/documentation/how_to/absolute_relative_paths.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -18,14 +18,14 @@ `Py++`_ does not handle relative paths, as input, well. It tries, but there are uses cases it fails. In these cases it generates empty module - nothing is exposed: -.. code-block:: Python +.. code-block:: python mb = module_builder( [ 'date_time/date_time.hpp' ], ... ) mb.split_module( ... ) I recommend you to use absolute paths instead of relative ones: -.. code-block:: Python +.. code-block:: python import os mb = module_builder( [ os.path.abspath('date_time/date_time.hpp') ], ... ) Modified: pyplusplus_dev/docs/documentation/how_to/best_practices.rest =================================================================== --- pyplusplus_dev/docs/documentation/how_to/best_practices.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pyplusplus_dev/docs/documentation/how_to/best_practices.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -41,7 +41,7 @@ ``module_builder_t.__init__`` method takes reference to an instance of cache class or ``None``: - .. code-block:: Python + .. code-block:: python from module_builder import * mb = module_builder_t( ..., cache=file_cache_t( <<<path to project cache file>>> ), ... ) @@ -60,7 +60,7 @@ implemented an initial version of the functionality. After small discussion, we agreed on the following interface: - .. code-block:: Python + .. code-block:: python class module_builder_t( ... ): ... @@ -77,7 +77,7 @@ `this error`_. `Py++`_ will automatically split generated code for the huge classes to few files: - .. code-block:: Python + .. code-block:: python mb = module_builder_t( ... ) ... @@ -99,7 +99,7 @@ recommended that you use "os.path.abspath()" to transform the header file to be processed into an absolute path: - .. code-block:: Python + .. code-block:: python #the following code will expose nothing mb = module_builder( [ 'date_time/date_time.hpp' ], ... ) @@ -148,7 +148,7 @@ instead of loading the content of the previously generated file from the disk and comparing against it. - .. code-block:: Python + .. code-block:: python mb = module_builder_t( ... ) ... Modified: pyplusplus_dev/docs/documentation/how_to/exception_translation.rest =================================================================== --- pyplusplus_dev/docs/documentation/how_to/exception_translation.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pyplusplus_dev/docs/documentation/how_to/exception_translation.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -25,7 +25,7 @@ what should be done. I will use that example, to show how it could be done with `Py++`_: -.. code-block:: Python +.. code-block:: python from pyplusplus import module_builder_t @@ -42,7 +42,7 @@ and than to create an instance of Python built-in exception. That is exactly why `Py++`_ provides additional API: -.. code-block:: Python +.. code-block:: python mb = module_builder_t( ... ) my_exception = mb.class_( 'my_exception' ) Modified: pyplusplus_dev/docs/documentation/how_to/file_name_too_long.rest =================================================================== --- pyplusplus_dev/docs/documentation/how_to/file_name_too_long.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pyplusplus_dev/docs/documentation/how_to/file_name_too_long.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -13,7 +13,7 @@ Let me explain. -.. code-block:: cpp +.. code-block:: c++ template < class T> struct holder{ ... }; @@ -27,7 +27,7 @@ It is pretty simple to change the alias of the class, or any other declaration: -.. code-block:: Python +.. code-block:: python from pyplusplus import module_builder Modified: pyplusplus_dev/docs/documentation/how_to/hints.rest =================================================================== --- pyplusplus_dev/docs/documentation/how_to/hints.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pyplusplus_dev/docs/documentation/how_to/hints.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -13,7 +13,7 @@ For example: -.. code-block:: cpp +.. code-block:: c++ #include <vector> typedef std::vector< int > numbers; @@ -23,7 +23,7 @@ `Py++`_ will use "numbers" as Python class name: -.. code-block:: cpp +.. code-block:: c++ using boost::python; class_< std::vector< int > >( "numbers" ) @@ -38,7 +38,7 @@ The previous approach is "implicit" - `Py++`_ does something behind the scene. Recently (version 0.8.6 ), another approach was introduced: -.. code-block:: cpp +.. code-block:: c++ #include <vector> Modified: pyplusplus_dev/docs/documentation/how_to/templates.rest =================================================================== --- pyplusplus_dev/docs/documentation/how_to/templates.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pyplusplus_dev/docs/documentation/how_to/templates.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -10,7 +10,7 @@ I would like to introduce the following piece of code. I am going to use it for most exlanations. -.. code-block:: cpp +.. code-block:: c++ // file point.h template< class T> @@ -39,14 +39,14 @@ You can instantiate template class using operator ``sizeof``: -.. code-block:: cpp +.. code-block:: c++ sizeof( point_t<int> ); In order to instantiate a function you have to call it: -.. code-block:: cpp +.. code-block:: c++ void instantiate(){ double x = distance( point_t<t>() ); @@ -64,7 +64,7 @@ can create a small code generator, which will "instantiate the class". It is pretty easy to blend together the generated code and the existing one: -.. code-block:: Python +.. code-block:: python from module_builder import module_builder_t, create_text_fc @@ -83,7 +83,7 @@ Functions templated on return type ---------------------------------- -.. code-block:: cpp +.. code-block:: c++ environment_t env; std::string path = env.get_value< std::string >( "PATH" ); @@ -105,7 +105,7 @@ Generated code: -.. code-block:: cpp +.. code-block:: c++ bp::class_< environment_t >( "environment_t" ) ... @@ -116,7 +116,7 @@ The correct code: -.. code-block:: cpp +.. code-block:: c++ bp::class_< environment_t >( "environment_t" ) .def( "get_value" @@ -128,7 +128,7 @@ The perfect one: -.. code-block:: cpp +.. code-block:: c++ bp::class_< environment_t >( "environment_t" ) ... @@ -141,7 +141,7 @@ `Py++`_ contains a work-around to the problem: -.. code-block:: Python +.. code-block:: python mb = module_builder_t( ..., optimize_queries=False, ... ) environment = mb.class_( "environment_t" ) Modified: pyplusplus_dev/docs/documentation/inserting_code.rest =================================================================== --- pyplusplus_dev/docs/documentation/inserting_code.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pyplusplus_dev/docs/documentation/inserting_code.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -18,7 +18,7 @@ Almost every ``Boost.Python`` module has the following structure: -.. code-block:: cpp +.. code-block:: c++ //declarations code ... @@ -45,7 +45,7 @@ Example ------- -.. code-block:: Python +.. code-block:: python mb = module_builder_t( ... ) mb.build_code_creator( ... ) @@ -60,7 +60,7 @@ ``class_t`` declaration defines few methods, which add user code to the generated one. Lets take a look on the following use case: -.. code-block:: cpp +.. code-block:: c++ struct window_t{ ... @@ -74,7 +74,7 @@ In the near future `Py++`_ will eliminate the need of creating hand written wrapper for this use case. -.. code-block:: cpp +.. code-block:: c++ boost::python::tuple get_window_size( const window_t& win ){ int h(0), w(0); @@ -84,7 +84,7 @@ Now you have to register it: -.. code-block:: cpp +.. code-block:: c++ using boost::python; class_< window_t >( ... ) @@ -113,7 +113,7 @@ What is ``works_on_instance`` argument for? In our case, we added new method to the class. The first argument of the call will be ``self``. - .. code-block:: Python + .. code-block:: python #From Python user can call this method like this: win = window_t( ) @@ -121,7 +121,7 @@ If you will pass ``works_on_instance=False`` the following code will be generated: - .. code-block:: cpp + .. code-block:: c++ { class_< window_t > window_exporter( "window_t" ); @@ -132,7 +132,7 @@ And in this case, user will be forced to pass reference to ``window_t`` object: - .. code-block:: cpp + .. code-block:: c++ win = window_t() height, width = window_t.get_size( win ) @@ -140,7 +140,7 @@ Example ------- -.. code-block:: Python +.. code-block:: python mb = module_builder_t( ... ) window = mb.class_( 'window_t' ) @@ -177,7 +177,7 @@ Solution -------- -.. code-block:: Python +.. code-block:: python def inject_code( cls ): constructors = cls.constructors() @@ -195,7 +195,7 @@ #If you need to add new class variables: cls.add_wrapper_code( <<<variable declaration>>> ) -.. code-block:: Python +.. code-block:: python mb = module_builder_t( ... ) for cls in mb.classes( <<<relevant classes only>>> ): @@ -212,7 +212,7 @@ 1. The easiest and the most effective one - tell to `Py++`_ that generated code for the declaration should include additional files: - .. code-block:: Python + .. code-block:: python mb = module_builder_t( ... ) my_class = mb.class_( ... ) @@ -224,7 +224,7 @@ 2. Other approach is a little bit low level, but it allows you to add your header files to every generated file: - .. code-block:: Python + .. code-block:: python mb = module_builder_t( ... ) ... @@ -233,7 +233,7 @@ You can also replace all (to be) generated header files with your own set: - .. code-block:: Python + .. code-block:: python mb.code_creator.replace_included_headers( ["stdafx.h"] ) Modified: pyplusplus_dev/docs/documentation/multi_module_development.rest =================================================================== --- pyplusplus_dev/docs/documentation/multi_module_development.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pyplusplus_dev/docs/documentation/multi_module_development.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -29,7 +29,7 @@ The code: -.. code-block:: cpp +.. code-block:: c++ namespace core{ class image_i{ @@ -55,7 +55,7 @@ Every `Py++`_ declaration has ``already_exposed`` property. This property says to `Py++`_ that the declaration is already exposed in another module: -.. code-block:: Python +.. code-block:: python #generate_code.py script @@ -72,7 +72,7 @@ `Py++`_ will generate code very similar to the the following one: -.. code-block:: cpp +.. code-block:: c++ //file core.cpp namespace bp = boost::python; @@ -95,7 +95,7 @@ .def( "load", bp::pure_virtual( &::core::image_i::load ) ); } -.. code-block:: cpp +.. code-block:: c++ //file png.cpp struct png_image_t_wrapper : png::png_image_t, bp::wrapper< png::png_image_t > { @@ -143,7 +143,7 @@ Usage example: -.. code-block:: Python +.. code-block:: python mb = module_builder_t( ... ) mb.register_module_dependency( <<<other module generated code directory>>> ) Modified: pyplusplus_dev/docs/documentation/properties.rest =================================================================== --- pyplusplus_dev/docs/documentation/properties.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pyplusplus_dev/docs/documentation/properties.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -19,7 +19,7 @@ Usage example ------------- -.. code-block:: cpp +.. code-block:: c++ struct number{ ... @@ -30,7 +30,7 @@ float m_value; } -.. code-block:: Python +.. code-block:: python mb = module_builder_t( ... ) number = mb.class_( 'number' ) @@ -43,7 +43,7 @@ built-in algorithm, which automatically recognizes properties and adds them to the class: -.. code-block:: Python +.. code-block:: python mb = module_builder_t( ... ) number = mb.class_( 'number' ) @@ -63,11 +63,11 @@ Consider the following use case: -.. code-block:: cpp +.. code-block:: c++ struct nested{ ... }; -.. code-block:: cpp +.. code-block:: c++ struct data{ ... @@ -82,7 +82,7 @@ `call policies`_. Same precondition holds for exposing member function as property: -.. code-block:: Python +.. code-block:: python mb = module_builder_t( ... ) get_nested = mb.member_function( 'get_nested' ) Modified: pyplusplus_dev/docs/documentation/split_module.rest =================================================================== --- pyplusplus_dev/docs/documentation/split_module.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pyplusplus_dev/docs/documentation/split_module.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -34,7 +34,7 @@ Usage example ------------- -.. code-block:: Python +.. code-block:: python from pyplusplus import module_builder @@ -86,7 +86,7 @@ Usage example ------------- -.. code-block:: Python +.. code-block:: python from pyplusplus import module_builder @@ -127,7 +127,7 @@ Usage example ------------- -.. code-block:: Python +.. code-block:: python from pyplusplus import module_builder @@ -148,7 +148,7 @@ Usage example ------------- -.. code-block:: Python +.. code-block:: python from pyplusplus import module_builder @@ -170,7 +170,7 @@ integrate/add this functionality to `Py++`_. Nevertheless, you can enjoy from this time-saving feature: -.. code-block:: Python +.. code-block:: python from pyplusplus import module_builder from pyplusplus import code_creators @@ -191,12 +191,12 @@ Class ``module_builder_t`` contains 3 functions, related to file generation: * - .. code-block:: Python + .. code-block:: python def write_module( file_name ) * - .. code-block:: Python + .. code-block:: python def split_module( self , dir_name @@ -227,7 +227,7 @@ forced to recompile the whole project. * - .. code-block:: Python + .. code-block:: python def balanced_split_module( self , dir_name Modified: pyplusplus_dev/docs/documentation/tutorials/module_builder/module_builder.rest =================================================================== --- pyplusplus_dev/docs/documentation/tutorials/module_builder/module_builder.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pyplusplus_dev/docs/documentation/tutorials/module_builder/module_builder.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -124,7 +124,7 @@ open source projects it to have license text within every source file. You can do it with one line of code only: -.. code-block:: Python +.. code-block:: python mb.code_creator.license = <<<your license text>>> Modified: pyplusplus_dev/docs/documentation/warnings.rest =================================================================== --- pyplusplus_dev/docs/documentation/warnings.rest 2009-01-26 19:49:49 UTC (rev 1622) +++ pyplusplus_dev/docs/documentation/warnings.rest 2009-01-26 20:00:13 UTC (rev 1623) @@ -24,11 +24,11 @@ some cases provide hints about how to resolve the problem. Few examples: * - .. code-block:: cpp + .. code-block:: c++ struct Y{ ... }; - .. code-block:: cpp + .. code-block:: c++ struct X{ ... @@ -38,7 +38,7 @@ Member function ``do_smth`` cannot be overridden in Python because ... . * - .. code-block:: cpp + .. code-block:: c++ struct window{ ... @@ -51,7 +51,7 @@ should define ``BOOST_PYTHON_MAX_ARITY`` macro. *... [truncated message content] |