diff options
author | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-30 19:59:38 +0100 |
---|---|---|
committer | Loek Le Blansch <loek@pipeframe.xyz> | 2024-10-30 19:59:38 +0100 |
commit | 6e1d62955c7a7f39bc9126d709a42a70e02a1d30 (patch) | |
tree | c2505409c68d554b1e776cdb0c8104af54d375bf /backend/Object.h | |
parent | c1d43cddee94dd370078f755d33147c9a8181852 (diff) |
create backend string class
Diffstat (limited to 'backend/Object.h')
-rw-r--r-- | backend/Object.h | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/backend/Object.h b/backend/Object.h index b98dc82..07b7b74 100644 --- a/backend/Object.h +++ b/backend/Object.h @@ -1,24 +1,26 @@ #pragma once +#include "String.h" + class Object { private: - const char * name = nullptr; - const char * description = nullptr; + String name; + String description; public: - void set_name(const char * name); - const char * get_name(); - virtual const char * get_displayname(); - void set_description(const char * description); - const char * get_description(); + void set_name(const String & name); + const String & get_name() const; + virtual const String & get_displayname() const; + void set_description(const String & description); + const String & get_description() const; void set_hidden(bool hidden); bool get_hidden(); protected: friend class ObjectFactory; - Object(const char * name = "", const char * description = ""); + Object(const String & name, const String & description); public: - virtual ~Object(); + virtual ~Object() = default; protected: bool hidden = false; |