Sip has a number of directives that control the way C++ code
is generated. Since sip is essentially completely undocumented,
it was impossible to clearly describe all directives, or even to
be sure that this is an exhaustive list. Still, this list come
in useful. The directives are grouped according to function:
Documentation, Modules, Conditional Elements, C++ and Header
Code, Python Code sections, Mapped Classes, Special Python
methods and Other.
- Table of Contents
- %Copying -- Start of software license
_block_
- %Doc -- Start of a documentation
_block_
- %ExportedDoc -- Start of an exported documentation
_block_
- Table of Contents
- %Module -- Definition of the (main) modules
name
- %Include -- Include a file
- %Import -- Import module (dynamic library)
- Table of Contents
- %If -- start of a conditional
_block_
- %End -- Terminate
_block_
- Version() -- Condition function for %If directive
- %Version -- Define version value(s) and evaluation
methods
- %PrimaryVersions -- Define list of primary versions
- %VersionCode -- Start of a version code
_block_
A mapped class
- cannot have super classes, member
functions or constructors.
- cannot have a %ConvertToSubClassCode directive.
- must have exactly one %ConvertFromClassCode directive.
- must have exactly one %ConvertToClassCode directive.
- must have exactly one %CanConvertToClassCode directive
Python special methods can be
implemented, but code must be supplied. The following
directives define additional sections in a class declaration
(like public, private etc.). A typical sip file section is as
follows:
class X
{
...
PyMethods:
__str__
%MemberCode
C++ code (no enclosing braces needed).
Number and kind of arguments and return value depend on method
(see specialPyMethod in sip.h).
%End
...
}
- Table of Contents
- %Makefile -- The start of a Makefile code
_block_