#pragma once #include #include #include #include using std::string; struct LicenseData { string Project; string Spdx; string LicenseContents = ""; inline void load_contents(const unsigned int *license_data, const unsigned int license_size) { std::vector vec(license_size); vec.resize(license_size); memcpy(vec.data(), license_data, license_size); vec.push_back('\0'); LicenseContents = string(vec.data()); DEBUG.writefln("Loading license for project '%s': %s...", Project, Spdx); } inline LicenseData(string project, string spdx) { this->Project = project; this->Spdx = spdx; } }; #define LOAD_LICENSE(data, prefix) if (data.LicenseContents == "") data.load_contents(prefix##_license_data, prefix##_license_size);