summaryrefslogtreecommitdiff
path: root/backend/pkgtools.h
diff options
context:
space:
mode:
Diffstat (limited to 'backend/pkgtools.h')
-rw-r--r--backend/pkgtools.h42
1 files changed, 23 insertions, 19 deletions
diff --git a/backend/pkgtools.h b/backend/pkgtools.h
index cedf315..b590232 100644
--- a/backend/pkgtools.h
+++ b/backend/pkgtools.h
@@ -1,36 +1,40 @@
-#ifndef __SLACK_PKGTOOLS_H
-#define __SLACK_PKGTOOLS_H
-
+/*
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at https://mozilla.org/MPL/2.0/.
+ */
+#pragma once
+
+#include <cstdint>
#include <glib-object.h>
#include <pk-backend.h>
+#include "utils.h"
namespace slack {
class Pkgtools
{
public:
- const gchar *get_name () const noexcept;
- const gchar *get_mirror () const noexcept;
- guint8 get_order () const noexcept;
- gboolean is_blacklisted (const gchar *pkg) const noexcept;
+ const char *get_name () const noexcept;
+ const char *get_mirror () const noexcept;
+ std::uint8_t get_order () const noexcept;
+ bool is_blacklisted (const char *pkg) const noexcept;
virtual ~Pkgtools () noexcept;
- gboolean download (PkBackendJob *job,
- gchar *dest_dir_name, gchar *pkg_name) noexcept;
- void install (PkBackendJob *job, gchar *pkg_name) noexcept;
+ bool download (JobData *job_data,
+ char *dest_dir_name, char *pkg_name) noexcept;
+ void install (JobData *job_data, char *pkg_name) noexcept;
- virtual GSList *collect_cache_info (const gchar *tmpl) noexcept = 0;
- virtual void generate_cache (PkBackendJob *job,
- const gchar *tmpl) noexcept = 0;
+ virtual GSList *collect_cache_info (const char *tmpl) noexcept = 0;
+ virtual void generate_cache (JobData *job_data,
+ const char *tmpl) noexcept = 0;
protected:
- gchar *name = NULL;
- gchar *mirror = NULL;
- guint8 order;
- GRegex *blacklist = NULL;
+ char *name = nullptr;
+ char *mirror = nullptr;
+ std::uint8_t order;
+ GRegex *blacklist = nullptr;
};
}
-
-#endif /* __SLACK_PKGTOOLS_H */