MDF Lib 2.2
Interface against MDF 3/4 files
Loading...
Searching...
No Matches
iattachment.h
Go to the documentation of this file.
1/*
2 * Copyright 2021 Ingemar Hedvall
3 * SPDX-License-Identifier: MIT
4 */
5
9#pragma once
10#include <optional>
11#include <string>
12#include "mdf/iblock.h"
13#include "mdf/imetadata.h"
14namespace mdf {
15
21class IAttachment : public IBlock {
22 public:
23 virtual ~IAttachment() override = default;
24
26 virtual void CreatorIndex(uint16_t creator) = 0;
27
34 [[nodiscard]] virtual uint16_t CreatorIndex() const = 0;
35
36
37 virtual void IsEmbedded(bool embed) = 0;
38 [[nodiscard]] virtual bool IsEmbedded() const = 0;
39
40 virtual void IsCompressed(bool compress) = 0;
41 [[nodiscard]] virtual bool IsCompressed() const = 0;
42
48 [[nodiscard]] virtual std::optional<std::string> Md5() const = 0;
49
56 virtual void FileName(const std::string& filename) = 0;
57
63 [[nodiscard]] virtual const std::string& FileName() const = 0;
64
70 virtual void FileType(const std::string& file_type) = 0;
71
77 [[nodiscard]] virtual const std::string& FileType() const = 0;
78
85 [[nodiscard]] virtual IMetaData* CreateMetaData() = 0;
86
92 [[nodiscard]] virtual IMetaData* MetaData() const = 0;
93};
94
95} // namespace mdf
Interface against an attached file.
Definition iattachment.h:21
virtual ~IAttachment() override=default
Default destructor.
virtual void CreatorIndex(uint16_t creator)=0
Sets the Creator index.
virtual uint16_t CreatorIndex() const =0
Returns the creator index.
virtual void FileName(const std::string &filename)=0
Sets the filename. Include path.
virtual void IsEmbedded(bool embed)=0
Set true if embedded.
virtual bool IsEmbedded() const =0
True if embedded.
virtual bool IsCompressed() const =0
True if compressed.
virtual void FileType(const std::string &file_type)=0
Sets the MIME type of the file.
virtual std::optional< std::string > Md5() const =0
Return the MDG checksum if it exist.
virtual const std::string & FileType() const =0
Returns the MIME type of the string.
virtual IMetaData * MetaData() const =0
Returns the meta-data (MD) block.
virtual IMetaData * CreateMetaData()=0
Create a meta-data (MD) block.
virtual void IsCompressed(bool compress)=0
Set true tp compress.
virtual const std::string & FileName() const =0
Returns the filename.
Base class for all MDF blocks.
Definition iblock.h:19
Interface against an meta data block (MD) in a MDF4 file.
Definition imetadata.h:27
All MDF blocks inherits from the IBlock class. The interface class is used internally in lists....
Main namespace for the MDF library.
Definition canmessage.h:17