#ifndef SIBS_PACKAGE_HPP #define SIBS_PACKAGE_HPP #include "../external/rapidjson/document.h" #include "Result.hpp" #include #include namespace sibs { enum class PackageType : int { // Compile as executable when compiling project with this directly. // If used in dependency, then fail because you can't (currently) have dependency to executable. EXECUTABLE, // Compile as static library when compiling project with this directly. // If used in dependency, then this is the preferred library type, but the dependant project can override this. STATIC, // Compile as dynamic library when compiling project with this directly. // If used in dependency, then this is the preferred library type, but the dependant project can override this. DYNAMIC, // Identical to DYNAMIC LIBRARY }; struct PackageMetadata { std::string description; std::string version; std::vector platforms; std::vector urls; }; class Package { public: /* * Get package list from url which contains json file. * Returns json document structure (rapidjson) */ static Result getPackageList(const char *url); /* * Return the first url in list. * TODO: If we fail to fetch package from first url, try other other ones in the list (or if the first url is too slow / takes too long to respond). * TODO: Add version matching with wildcard etc. If we specify "1.2.*", then it should get the latest version that matches; etc... */ static Result getPackageUrl(const char *packageName, const char *packageVersion, const char *platform); }; } #endif //SIBS_PACKAGE_HPP