| | |
| | | - travis_wait 30 ./b2 toolset=gcc-mingw target-os=windows address-model=64 --with-date_time --with-test --with-filesystem --with-program_options --with-regex --with-serialization --with-system runtime-link=static --prefix=./dist release install |
| | | - cd .. |
| | | - cmake -DCMAKE_TOOLCHAIN_FILE=../cmake/toolchain-ubuntu-mingw64.cmake -DCMAKE_INSTALL_PREFIX=../../install -DBOOST_ROOT=$PWD/boost_1_71_0/dist .. |
| | | script: |
| | | - cmake --build . --target install --config Release |
| | | #disabling tests for now. Need to compile and install openssl... |
| | | - os: windows |
| | | name: "Widnows server 1803 - Visual Studio 15 2017 Win64 - (/MD)" |
| | | before_script: |
| | |
| | | #include "locate/LocatorFactory.hpp" |
| | | |
| | | namespace license { |
| | | using namespace std; |
| | | |
| | | FullLicenseInfo::FullLicenseInfo(const string &source, const string &product, const string &license_signature) |
| | | : source(source), |
| | |
| | | |
| | | LicenseReader::LicenseReader(const LicenseLocation *licenseLocation) : licenseLocation(licenseLocation) {} |
| | | |
| | | EventRegistry LicenseReader::readLicenses(const string &product, vector<FullLicenseInfo> &licenseInfoOut) { |
| | | EventRegistry LicenseReader::readLicenses(const string &product, vector<FullLicenseInfo> &licenseInfoOut) const { |
| | | vector<string> diskFiles; |
| | | vector<unique_ptr<locate::LocatorStrategy>> locator_strategies; |
| | | FUNCTION_RETURN ret = locate::LocatorFactory::get_active_strategies(locator_strategies, licenseLocation); |
| | |
| | | CSimpleIniA ini; |
| | | for (auto it = licenseLocations.begin(); it != licenseLocations.end(); it++) { |
| | | ini.Reset(); |
| | | string license = locator->retrieve_license_content((*it).c_str()); |
| | | const string license = locator->retrieve_license_content((*it).c_str()); |
| | | const SI_Error rc = ini.LoadData(license.c_str(), license.size()); |
| | | if (rc < 0) { |
| | | eventRegistry.addEvent(FILE_FORMAT_NOT_RECOGNIZED, *it); |
| | |
| | | } |
| | | |
| | | #ifdef _DEBUG |
| | | cout << "[" << oss.str() << "]" << endl; |
| | | cout << "license to sign [" << oss.str() << "]" << endl; |
| | | #endif |
| | | return oss.str(); |
| | | } |
| | |
| | | |
| | | public: |
| | | LicenseReader(const LicenseLocation* licenseLocation); |
| | | EventRegistry readLicenses(const std::string& product, std::vector<FullLicenseInfo>& licenseInfoOut); |
| | | EventRegistry readLicenses(const std::string& product, std::vector<FullLicenseInfo>& licenseInfoOut) const; |
| | | virtual ~LicenseReader(); |
| | | }; |
| | | } // namespace license |
| | |
| | | #include <vector> |
| | | |
| | | namespace license { |
| | | using namespace std; |
| | | |
| | | /** |
| | | * Eliminate whitespace from both sides of a string and returns a copy |
| | |
| | | * @param string_to_trim |
| | | * @return the trimmed string |
| | | */ |
| | | string trim_copy(const string& string_to_trim); |
| | | std::string trim_copy(const std::string& string_to_trim); |
| | | |
| | | string toupper_copy(const string& lowercase); |
| | | std::string toupper_copy(const std::string& lowercase); |
| | | |
| | | time_t seconds_from_epoch(const char* s); |
| | | |
| | | /** |
| | | * Split a string on a given character |
| | | */ |
| | | const vector<string> split_string(const string& stringToBeSplit, const char splitchar); |
| | | const std::vector<std::string> split_string(const std::string& stringToBeSplit, const char splitchar); |
| | | |
| | | typedef enum { |
| | | INI, BASE64, UNKNOWN |
| | | } FILE_FORMAT; |
| | | |
| | | FILE_FORMAT identify_format(const string& license); |
| | | |
| | | FILE_FORMAT identify_format(const std::string& license); |
| | | } |
| | | |
| | | /* namespace license */ |
| | |
| | | |
| | | EVENT_TYPE acquire_license(const CallerInformations* callerInformation, const LicenseLocation* licenseLocation, |
| | | LicenseInfo* license_out) { |
| | | license::LicenseReader lr = license::LicenseReader(licenseLocation); |
| | | const license::LicenseReader lr = license::LicenseReader(licenseLocation); |
| | | vector<license::FullLicenseInfo> licenses; |
| | | string project; |
| | | if (callerInformation != nullptr && strlen(callerInformation->project_name) > 0) { |
| | |
| | | const int retCode = std::system(ss.str().c_str()); |
| | | BOOST_CHECK_EQUAL(retCode, 0); |
| | | BOOST_ASSERT(fs::exists(outputFile)); |
| | | std::ifstream ifs(outputFile.c_str()); |
| | | std::ifstream ifs(output_file_s.c_str()); |
| | | std::string content((std::istreambuf_iterator<char>(ifs)), (std::istreambuf_iterator<char>())); |
| | | return content; |
| | | } |