OpenLexocad  27.0
PropertyEmbeddedFile.h
Go to the documentation of this file.
1 #pragma once
2 #include <Base/String.h>
3 #include <Base/md5.h>
4 #include <Core/core_defines2.h>
5 
6 #include <QByteArray>
7 #include <string>
8 
9 #include "Core/Property.h"
10 #include "Core/Variant.h"
11 
12 namespace Core
13 {
15 {
17 
18 public:
20  virtual ~PropertyEmbeddedFile(void);
21 
22  void setValue(const QByteArray& content);
23  void setFilename(const Base::String& filepath);
24  bool setValueFromVariant(const Core::Variant& value);
25  void copyValue(Core::Property* p);
26 
27  Base::String getValue() const;
28  Core::Variant getVariant(void) const;
29 
30  virtual void save(Base::AbstractWriter& writer, Base::PersistanceVersion& save_version);
31  virtual void restore(Base::AbstractXMLReader& reader, Base::PersistanceVersion& version);
32  virtual bool isEqual(const Property*) const;
33  bool hasContent();
34  Base::String getFileName();
35  QByteArray getContent();
36  bool isSaveInLine();
37 
38 protected:
40  QByteArray _content;
43 };
44 
45 
46 
47 DECLARE_PROPERTY_FACTORY(PropertyEmbeddedFile_Factory, Core::PropertyEmbeddedFile);
48 
49 } // namespace Core
#define CORE_EXPORT
Definition: core_defines2.h:10
Definition: PropertyEmbeddedFile.h:14
Definition: md5.h:71
A Utf-16 (windows) or ucs4 (unix) encoded string class.
Definition: String.h:29
Definition: Persistance.h:20
LX_CORE_EXPORT Version & version
Definition: Variant.h:90
Definition: AbstractXMLReader.h:10
Definition: Base.h:19
Definition: Writer.h:27
Base::String _filepath
Definition: PropertyEmbeddedFile.h:39
QByteArray _content
Definition: PropertyEmbeddedFile.h:40
bool _saveInline
Definition: PropertyEmbeddedFile.h:42
Definition: Property.h:81
MD5 _md5
Definition: PropertyEmbeddedFile.h:41
TYPESYSTEM_HEADER()
DECLARE_PROPERTY_FACTORY(PropertyAxis1_Factory, Core::PropertyAxis1)