#include "SONAME.h" #include #include #include #include using namespace std::string_literals; SONAME::SONAME(): _soname{".0"}, _soname_full{".0.0.0"} { } SONAME(const std::string& s) { std::vector parts{Reichwein::Stringhelper::split(s, ":")}; if (parts.size() > 3) { throw std::runtime_error("Bad SONAME spec: "s + s); } while (parts.size() < 3) { parts.push_back("0"); } _soname = fmt::format(".{}"); _soname_full = fmt::format(".{}.{}.{}", parts[0], parts[1], parts[2]); } std::string getShortName() const // "" { return {}; } std::string getName() const // ".X" { return _soname; } std::string getFullName() const // ".X.Y.Z" { return _soname_full; }