mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 00:27:45 +00:00
Utilities: Add basic Package manager skeleton utility
This commit is contained in:
parent
22737b70bc
commit
ccaa423372
9 changed files with 473 additions and 0 deletions
36
Userland/Utilities/pkg/AvailablePort.h
Normal file
36
Userland/Utilities/pkg/AvailablePort.h
Normal file
|
@ -0,0 +1,36 @@
|
|||
/*
|
||||
* Copyright (c) 2023, Liav A. <liavalb@hotmail.co.il>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "InstalledPort.h"
|
||||
#include <AK/HashMap.h>
|
||||
#include <AK/String.h>
|
||||
#include <AK/StringView.h>
|
||||
#include <AK/Types.h>
|
||||
|
||||
class AvailablePort {
|
||||
public:
|
||||
static ErrorOr<int> query_details_for_package(HashMap<String, AvailablePort>& available_ports, HashMap<String, InstalledPort>& installed_ports, StringView package_name, bool verbose);
|
||||
static ErrorOr<HashMap<String, AvailablePort>> read_available_ports_list();
|
||||
static ErrorOr<int> update_available_ports_list_file();
|
||||
|
||||
AvailablePort(String name, String version, String website)
|
||||
: m_name(name)
|
||||
, m_website(move(website))
|
||||
, m_version(move(version))
|
||||
{
|
||||
}
|
||||
|
||||
StringView name() const { return m_name.bytes_as_string_view(); }
|
||||
StringView version() const { return m_version.bytes_as_string_view(); }
|
||||
StringView website() const { return m_website.bytes_as_string_view(); }
|
||||
|
||||
private:
|
||||
String m_name;
|
||||
String m_website;
|
||||
String m_version;
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue