#include <environment_factory.hh>
Public Types | |
typedef std::tr1::function < const std::tr1::shared_ptr < Environment >const std::string &)> | CreateFunction |
Public Member Functions | |
const std::tr1::shared_ptr < Environment > | create (const std::string &spec) const PALUDIS_ATTRIBUTE((warn_unused_result)) |
void | add_environment_format (const std::tr1::shared_ptr< const Set< std::string > > &formats, const CreateFunction &create_function) |
Friends | |
class | InstantiationPolicy< EnvironmentFactory, instantiation_method::SingletonTag > |
const std::tr1::shared_ptr<Environment> paludis::EnvironmentFactory::create | ( | const std::string & | spec | ) | const |
Create an Environment subclass from the specified spec.
spec | The environment spec, which is in the form env:suffix, where env is the string representing an Environment's kind (e.g. "paludis", "portage") and suffix is the information to pass to the constructing function (for paludis, a config suffix, and for portage, a location). If env is not specified, it defaults to trying paludis then portage. If suffix is not specified, it defaults to an empty string. If no colon is present, the supplied string is taken as env (this includes an empty string). |
void paludis::EnvironmentFactory::add_environment_format | ( | const std::tr1::shared_ptr< const Set< std::string > > & | formats, | |
const CreateFunction & | create_function | |||
) |
Add a repository format.
formats | must have at least one value, and no value may be specified more than once across all invocations. | |
create_function | is used to implement EnvironmentFactory::create. |