From 49ea3a98b9425a7269c0f9343c2876ffded26d2c Mon Sep 17 00:00:00 2001 From: "A. Wilcox" Date: Sat, 5 Oct 2019 21:09:39 -0500 Subject: More API work --- hscript/disk.hh | 34 ++++++++++++++++++++++++++++++++++ hscript/key.hh | 3 --- hscript/meta.hh | 21 +++++++++++++++++++++ hscript/network.hh | 25 +++++++++++++++++++++++++ hscript/script.cc | 11 +++++++++++ hscript/user.hh | 31 +++++++++++++++++++++++++++++++ 6 files changed, 122 insertions(+), 3 deletions(-) create mode 100644 hscript/disk.hh create mode 100644 hscript/meta.hh create mode 100644 hscript/network.hh create mode 100644 hscript/user.hh diff --git a/hscript/disk.hh b/hscript/disk.hh new file mode 100644 index 0000000..cddbb10 --- /dev/null +++ b/hscript/disk.hh @@ -0,0 +1,34 @@ +/* + * disk.hh - Definition of the disk Key classes + * libhscript, the HorizonScript library for + * Project Horizon + * + * Copyright (c) 2019 Adélie Linux and contributors. All rights reserved. + * This code is licensed under the AGPL 3.0 license, as noted in the + * LICENSE-code file in the root directory of this repository. + * + * SPDX-License-Identifier: AGPL-3.0-only + */ + +#include "key.hh" + +namespace Horizon { +namespace Keys { + +class DiskId : public Key { +}; + +class DiskLabel : public Key { +}; + +class Partition : public Key { +}; + +class Filesystem : public Key { +}; + +class Mount : public Key { +}; + +} +} diff --git a/hscript/key.hh b/hscript/key.hh index 5a9613b..cce1460 100644 --- a/hscript/key.hh +++ b/hscript/key.hh @@ -21,9 +21,6 @@ namespace Keys { */ class Key { public: - /*! Create an instance of the Key. */ - static Key *create(); - /*! Set the data associated with the Key. */ void setData(std::string data); diff --git a/hscript/meta.hh b/hscript/meta.hh new file mode 100644 index 0000000..c1eba90 --- /dev/null +++ b/hscript/meta.hh @@ -0,0 +1,21 @@ +/* + * meta.hh - Definition of the Key classes for system metadata + * libhscript, the HorizonScript library for + * Project Horizon + * + * Copyright (c) 2019 Adélie Linux and contributors. All rights reserved. + * This code is licensed under the AGPL 3.0 license, as noted in the + * LICENSE-code file in the root directory of this repository. + * + * SPDX-License-Identifier: AGPL-3.0-only + */ + +#include "key.hh" + +namespace Horizon { +namespace Keys { + + + +} +} diff --git a/hscript/network.hh b/hscript/network.hh new file mode 100644 index 0000000..4c21155 --- /dev/null +++ b/hscript/network.hh @@ -0,0 +1,25 @@ +/* + * network.hh - Definition of the network Key classes + * libhscript, the HorizonScript library for + * Project Horizon + * + * Copyright (c) 2019 Adélie Linux and contributors. All rights reserved. + * This code is licensed under the AGPL 3.0 license, as noted in the + * LICENSE-code file in the root directory of this repository. + * + * SPDX-License-Identifier: AGPL-3.0-only + */ + +#include "key.hh" + +namespace Horizon { +namespace Keys { + +class NetAddress : public Key { +}; + +class NetSSID : public Key { +}; + +} +} diff --git a/hscript/script.cc b/hscript/script.cc index 98c451d..72f9dd8 100644 --- a/hscript/script.cc +++ b/hscript/script.cc @@ -11,10 +11,21 @@ */ #include "script.hh" +#include "disk.hh" namespace Horizon { struct Script::ScriptPrivate { + /*! Determines whether or not to enable networking. */ + bool network; + /*! The target system's hostname. */ + std::string hostname; + /*! The packages to install to the target system. */ + std::vector packages; + /*! The root shadow line. */ + std::string rootpw; + /*! Target system's mountpoints. */ + std::vector< std::unique_ptr > mounts; }; Script::Script() { diff --git a/hscript/user.hh b/hscript/user.hh new file mode 100644 index 0000000..af42519 --- /dev/null +++ b/hscript/user.hh @@ -0,0 +1,31 @@ +/* + * user.hh - Definition of the Key classes for user account data + * libhscript, the HorizonScript library for + * Project Horizon + * + * Copyright (c) 2019 Adélie Linux and contributors. All rights reserved. + * This code is licensed under the AGPL 3.0 license, as noted in the + * LICENSE-code file in the root directory of this repository. + * + * SPDX-License-Identifier: AGPL-3.0-only + */ + +#include "key.hh" + +namespace Horizon { +namespace Keys { + +class UserAlias : public Key { +}; + +class UserPassphrase : public Key { +}; + +class UserIcon : public Key { +}; + +class UserGroups : public Key { +}; + +} +} -- cgit v1.2.3-70-g09d2