| | |
| | | * Author: Gabriele Contini |
| | | */ |
| | | |
| | | #include "licensecc_properties.h" |
| | | |
| | | #include "LocatorStrategy.hpp" |
| | | #include "LocatorFactory.hpp" |
| | | #include "ApplicationFolder.hpp" |
| | |
| | | |
| | | namespace license { |
| | | namespace locate { |
| | | static std::vector<std::unique_ptr<LocatorStrategy>> extra_strategies; |
| | | |
| | | bool LocatorFactory::find_license_near_moduleb = FIND_LICENSE_NEAR_MODULE; |
| | | bool LocatorFactory::find_license_with_env_varb = FIND_LICENSE_WITH_ENV_VAR; |
| | | FUNCTION_RETURN LocatorFactory::get_active_strategies(std::vector<std::unique_ptr<LocatorStrategy>> &strategies, |
| | | const LicenseLocation *locationHint) { |
| | | #if (FIND_LICENSE_NEAR_MODULE) |
| | | if (find_license_near_moduleb) { |
| | | strategies.push_back(std::unique_ptr<LocatorStrategy>((LocatorStrategy *)new ApplicationFolder())); |
| | | #endif |
| | | #if (FIND_LICENSE_WITH_ENV_VAR) |
| | | } |
| | | if (find_license_with_env_varb) { |
| | | strategies.push_back(std::unique_ptr<LocatorStrategy>((LocatorStrategy *)new EnvironmentVarLocation())); |
| | | strategies.push_back(std::unique_ptr<LocatorStrategy>((LocatorStrategy *)new EnvironmentVarData())); |
| | | #endif |
| | | } |
| | | if (locationHint != nullptr) { |
| | | strategies.push_back(std::unique_ptr<LocatorStrategy>((LocatorStrategy *)new ExternalDefinition(locationHint))); |
| | | } |