looper/backends/ui/imgui/license.h

25 lines
No EOL
850 B
C++

#pragma once
#include <string>
#include <vector>
#include <cstring>
#include <log.hpp>
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<char> 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);