speciesgen/include/starbound/metadata.h

94 lines
2.9 KiB
C++

/*
speciesgen
Copyright (C) 2022-2023 prisixia
This file is part of speciesgen.
speciesgen is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
speciesgen is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with speciesgen. If not, see <https://www.gnu.org/licenses/>.
*/
/////////////////////////////////////////////////////////////////////////////
// Name: metadata.cpp
// Purpose: Implementation of Metadata
// Author: prisixia
// Created: 2022-10-02
// Copyright: (C) 2022-2023 prisixia
// Licence: GNU General Public License version 3
/////////////////////////////////////////////////////////////////////////////
#ifndef SPECIESGEN_STARBOUND_METADATA_H
#define SPECIESGEN_STARBOUND_METADATA_H
#include <filesystem>
#include <fstream>
#include <string>
#include <vector>
#include "rapidjson/ostreamwrapper.h"
#include "rapidjson/prettywriter.h"
namespace Starbound {
class Metadata {
public:
Metadata(const std::string, const std::string, const std::string,
const std::string =
"This mod has been generated via speciesgen made by prisixia.",
const std::string = "1.0.0_gen" SPECIESGEN_VERSION,
const std::string = "http://git.vern.cc/prisixia/speciesgen",
const std::vector<std::string> = {"starpounds"});
std::string GetName() const;
std::string GetFriendlyName() const;
std::string GetDescription() const;
std::string GetAuthor() const;
std::string GetVersion() const;
std::string GetLink() const;
std::string GetSteamContentID() const;
std::string GetTags() const;
std::vector<std::string> GetIncludes() const;
std::vector<std::string> GetRequires() const;
uint32_t GetPriority() const;
void SetName(const std::string);
void SetFriendlyName(const std::string);
void SetDescription(const std::string);
void SetAuthor(const std::string);
void SetVersion(const std::string);
void SetLink(const std::string);
void SetSteamContentID(const std::string);
void SetTags(const std::string);
void SetIncludes(const std::vector<std::string>);
void SetRequires(const std::vector<std::string>);
void SetPriority(const uint32_t);
void Serialize(const std::filesystem::path) const;
template <typename Writer> void Serialize(Writer &) const;
private:
std::string m_name;
std::string m_friendlyName;
std::string m_description;
std::string m_author;
std::string m_version;
std::string m_link;
std::string m_steamContentId;
std::string m_tags;
std::vector<std::string> m_includes;
std::vector<std::string> m_requires;
uint32_t m_priority;
};
} // namespace Starbound
#endif // SPECIESGEN_STARBOUND_METADATA_H