OpenLexocad  28.0
PropertyFile.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <Core/Property.h>
4 #include <sstream>
5 
6 namespace Core
7 {
8 class LX_CORE_EXPORT PropertyFile : public Core::Property
9 {
11 
12 public:
13 
14  void setValue(const Base::String& filepath);
15  bool setValueFromVariant(const Core::Variant& value);
17 
18  const Base::String& getValue() const;
19 
21 
22  virtual void save(Base::AbstractWriter& writer, Base::PersistenceVersion& save_version);
24  virtual bool isEqual(const Property*) const;
25  virtual Core::Property* copy(void) const override;
26  virtual void paste(const Core::Property& from) override;
27 
28 protected:
30  std::stringstream _memstream;
31 };
32 
33 
34 
36 
37 
38 } // namespace Core
Property.h
Core::PropertyFile::_memstream
std::stringstream _memstream
Definition: PropertyFile.h:30
Core::PropertyFile::restore
virtual void restore(Base::AbstractXMLReader &reader, Base::PersistenceVersion &version)
This method is used to restore properties from an XML document.
Core::PropertyFile::paste
virtual void paste(const Core::Property &from) override
Paste the value from the property (mainly for Undo/Redo and transactions)
Base::PersistenceVersion
Definition: Persistence.h:13
Core::PropertyFile::copyValue
void copyValue(Core::Property *p)
Core
Definition: Base.h:5
Core::Variant
Definition: Variant.h:78
Base::AbstractWriter
Definition: Writer.h:13
Core::PropertyFile::getValue
const Base::String & getValue() const
Core::PropertyFile::setValue
void setValue(const Base::String &filepath)
Base::AbstractXMLReader
Definition: AbstractXMLReader.h:7
Core::PropertyFile::copy
virtual Core::Property * copy(void) const override
Returns a new copy of the property (mainly for Undo/Redo and transactions). The copy has no container...
Core::version
LX_CORE_EXPORT Version & version
Core::Property
Definition: Property.h:72
Core::PropertyFile::_filepath
Base::String _filepath
Definition: PropertyFile.h:29
Core::PropertyFile::getVariant
Core::Variant getVariant(void) const
Base::String
A Utf-16 (windows) or ucs4 (unix) encoded string class.
Definition: String.h:18
Core::PropertyFile
Definition: PropertyFile.h:9
TYPESYSTEM_HEADER
#define TYPESYSTEM_HEADER()
define for subclassing Base::BaseClass
Definition: Base.h:12
Core::DECLARE_PROPERTY_FACTORY
DECLARE_PROPERTY_FACTORY(PropertyAxis1_Factory, Core::PropertyAxis1)
Core::PropertyFile::isEqual
virtual bool isEqual(const Property *) const
compare properties
Core::PropertyFile::setValueFromVariant
bool setValueFromVariant(const Core::Variant &value)
Core::PropertyFile::save
virtual void save(Base::AbstractWriter &writer, Base::PersistenceVersion &save_version)
This method is used to save properties or very small amounts of data to an XML document.