OpenTwin 0.1
OpenTwin
 
Loading...
Searching...
No Matches
PropertyDirectory.h
Go to the documentation of this file.
1
4// ###########################################################################################################################################################################################################################################################################################################################
5
6#pragma once
7
8// OpenTwin header
9#include "OTGui/Property.h"
10
11// std header
12#include <string>
13
14namespace ot {
15
18 public:
20 PropertyDirectory(const PropertyBase& _base);
21 PropertyDirectory(PropertyFlags _flags = PropertyFlags(NoFlags)) : Property(_flags) {};
22 PropertyDirectory(const std::string& _path, PropertyFlags _flags = PropertyFlags(NoFlags)) : Property(_flags), m_path(_path) {};
23 PropertyDirectory(const std::string& _name, const std::string& _path, PropertyFlags _flags = PropertyFlags(NoFlags)) : Property(_name, _flags), m_path(_path) {};
24 virtual ~PropertyDirectory() {};
25
26 static std::string propertyTypeString(void) { return "Directory"; };
27 virtual std::string getPropertyType(void) const override { return PropertyDirectory::propertyTypeString(); };
28
29 virtual Property* createCopy(void) const override;
30
31 void setPath(const std::string& _path) { m_path = _path; };
32
33 const std::string& getPath(void) const { return m_path; };
34
35 protected:
40 virtual void getPropertyData(ot::JsonValue& _object, ot::JsonAllocator& _allocator) const override;
41
45 virtual void setPropertyData(const ot::ConstJsonObject& _object) override;
46
47 private:
48 std::string m_path;
49 };
50
51}
#define OT_DECL_NOCOPY(___class)
Removes the default copy constructor and assignment operator.
Definition OTClassHelper.h:14
#define OT_GUI_API_EXPORT
Definition OTGuiAPIExport.h:9
The PropertyBase class is used to hold general Property information.
Definition PropertyBase.h:25
Definition PropertyDirectory.h:16
const std::string & getPath(void) const
Definition PropertyDirectory.h:33
static std::string propertyTypeString(void)
Definition PropertyDirectory.h:26
virtual std::string getPropertyType(void) const override
Definition PropertyDirectory.h:27
virtual ~PropertyDirectory()
Definition PropertyDirectory.h:24
PropertyDirectory(PropertyFlags _flags=PropertyFlags(NoFlags))
Definition PropertyDirectory.h:21
void setPath(const std::string &_path)
Definition PropertyDirectory.h:31
PropertyDirectory(const std::string &_name, const std::string &_path, PropertyFlags _flags=PropertyFlags(NoFlags))
Definition PropertyDirectory.h:23
PropertyDirectory(const std::string &_path, PropertyFlags _flags=PropertyFlags(NoFlags))
Definition PropertyDirectory.h:22
The Property class is used as a base class for all Properties that can be displayed and modified in t...
Definition Property.h:21
Definition Connector.h:8
rapidjson::Value JsonValue
Writable JSON value.
Definition JSON.h:27
rapidjson::GenericObject< true, rapidjson::GenericValue< rapidjson::UTF8<>, rapidjson::MemoryPoolAllocator< rapidjson::CrtAllocator > > > ConstJsonObject
Read only JSON Object.
Definition JSON.h:35
rapidjson::MemoryPoolAllocator< rapidjson::CrtAllocator > JsonAllocator
Allocator used for writing to JSON values.
Definition JSON.h:30