-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLibrary.hpp
More file actions
57 lines (45 loc) · 2.29 KB
/
Library.hpp
File metadata and controls
57 lines (45 loc) · 2.29 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//
// AmigaOS C++ wrapper
//
// (c) 2024 TDolphin
//
#pragma once
#include "ValueTypes/GVF.hpp"
#include "std/optional.hpp"
#include <dos/dos.h>
#include <dos/dosextens.h>
#include <string>
#include <vector>
namespace AOS::Dos
{
struct Library
{
/// @brief calls exec:FindProcess(NULL), check type (NT_PROCESS) and return casted struct Task* to struct Process*
static struct Process *FindProcess() noexcept;
/// @brief calls exec:FindProcess(name), check type (NT_PROCESS) and return casted struct Task* to struct Process*
static struct Process *FindProcess(const std::string &name) noexcept;
/// @brief dos.library/Cli(void)
static struct CommandLineInterface *libCli() noexcept;
/// @brief dos.library/NameFromLock(lock) .. name from lock
static std::string libNameFromLock(BPTR lock) noexcept;
/// @brief dos.library/CreateDir()
static BPTR libCreateDir(const std::string &name) noexcept;
/// @brief dos.library/DeleteFile()
static bool libDeleteFile(const std::string &fileName) noexcept;
/// @brief dos.library/Rename()
static bool libRename(const std::string &oldName, std::string &newName) noexcept;
/// @brief dos.library/GetCurrentDirName (returns the current directory name)
static std::string libGetCurrentDirName() noexcept;
/// @brief dos.library/ExAll (Examine an entire directory)
static std::vector<std::string> libExAll(const std::string &path, const std::string &pattern = "",
const bool files = true) noexcept;
/// @brief dos.library/FindDosEntry (Finds a specific Dos List entry)
static struct DosList *libFindDosEntry(const std::string &name, const unsigned long flags) noexcept;
/// @brief dos.library/AssignAdd(name, lock) .. lock from path
static bool libAssignAdd(const std::string &name, const std::string &path) noexcept;
/// @brief dos.library/GetVar (Get a system or local variable)
/// The default is to try to get a local variable first, then
/// to try to get a global environment variable.
static std::optional<std::string> libGetVar(const std::string &name, const enum AOS::Dos::GVF type = AOS::Dos::GVF::Var) noexcept;
};
}