Paludis Logo Introduction Examples
Bugs, Requests, Support C++ (core)
Overview Ruby (bindings)
FAQ Python (bindings)
Clients  
Configuration  
API  

API

Compiling C++ Code

You will need to specify various compiler flags when compiling C++ code. The usual way to do this is via pkg-config:

$ g++ -c `pkg-config --cflags paludis` -o example_command_line.o example_command_line.cc
$ g++ -c `pkg-config --cflags paludis` -o example_action.o example_action.cc
$ g++ `pkg-config --libs paludis` -o example_action example_command_line.o example_action.o

If you are using autotools, consider using PKG_CHECK_MODULES rather than calling pkg-config by hand.

Examples

There are examples showing how to use various classes. Many examples are available in more than one language, showing how concepts map on to different language bindings.

Example Language Description
example_command_line C++: hh cc Ruby Python Common command line code (not a standalone example)
example_about C++ Ruby Python How to use Paludis version macros
example_action C++ Ruby How to use actions
example_contents C++ Ruby How to use contents
example_dep_label C++ How to handle dependency labels
example_dep_spec C++ Ruby How to handle dependency specs
example_dep_spec_flattener C++ How to use DepSpecFlattener
example_dep_tree C++ Ruby How to handle dependency specs
example_environment C++ Ruby How to use EnvironmentFactory and the resultant Environment
example_mask C++ Ruby How to use Mask
example_match_package C++ Ruby How to use paludis::match_package and paludis::match_package_in_set
example_metadata_key C++ How to use MetadataKey
example_name C++ How to use name classes
example_package_id C++ Ruby How to use PackageID
example_repository C++ Ruby How to use Repository
example_selection C++ Ruby How to use the standard Selection, Generator and Filter classes
example_version_operator C++ Ruby How to use VersionOperator
example_version_spec C++ Ruby Python How to use VersionSpec