Implemented parallel downloads through CURL multi interface and added purge command

- Update `README.md` file with examples
- Fixed error messages showing no or wrong message
- Changed the prompt message when installing, removing, etc.
- Changed how http::request works
- Added `http::multi` class for parallel downloads
- Removed separate `concepts.hpp` file
TODO: Fix ZIP not extracting after running the `install` command
This commit is contained in:
David Allen 2023-07-10 20:26:15 -06:00
parent 766eabd5b2
commit 807aa8e5b2
21 changed files with 1158 additions and 758 deletions

View file

@ -2,13 +2,12 @@
#include "log.hpp"
#include "error.hpp"
#include "types.hpp"
#include <functional>
#include <type_traits>
namespace gdpm{
template <class T, error_t U = error>
template <class T, concepts::error_t U = error>
class result_t {
public:
result_t() = delete;
@ -35,13 +34,14 @@ namespace gdpm{
fn_error = error;
}
constexpr U get_error() const{
return std::get<U>(data);
}
constexpr std::unique_ptr<T> unwrap() const {
/* First, check if ok() and error() are defined. */
if(!fn_error || !fn_ok){
error error(
constants::error::NOT_DEFINED
);
log::error(error);
log::error(error(ec::NOT_DEFINED));
return nullptr;
}
/* Then, attempt unwrap the data. */