aboutsummaryrefslogtreecommitdiff
path: root/include/Package.hpp
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2018-01-04 01:01:35 +0100
committerdec05eba <dec05eba@protonmail.com>2018-01-04 01:01:42 +0100
commita548abb5a6a83c9318e9db3cf71170a7610e2758 (patch)
treee8556530f15102054f6175dc7a3438aaaaf8d77e /include/Package.hpp
parente862bb76a2f4c9c293fe2638c7fb034de2af709c (diff)
Use packages list to find packages
Diffstat (limited to 'include/Package.hpp')
-rw-r--r--include/Package.hpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/Package.hpp b/include/Package.hpp
index 106a48d..475e11b 100644
--- a/include/Package.hpp
+++ b/include/Package.hpp
@@ -1,6 +1,10 @@
#ifndef SIBS_PACKAGE_HPP
#define SIBS_PACKAGE_HPP
+#include "../external/rapidjson/document.h"
+#include "Result.hpp"
+#include <string>
+
namespace sibs
{
enum class PackageType : int
@@ -20,6 +24,23 @@ namespace sibs
// Identical to DYNAMIC
LIBRARY
};
+
+ class Package
+ {
+ public:
+ /*
+ * Get package list from url which contains json file.
+ * Returns json document structure (rapidjson)
+ */
+ static Result<rapidjson::Document*> 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<std::string> getPackageUrl(const char *packageName, const char *packageVersion);
+ };
}
#endif //SIBS_PACKAGE_HPP