lib/mdflib/docs/manual/html/imetadata_8h_source.html
| MDF Lib 2.2
Interface against MDF 3/4 files |
Loading...
Searching...
No Matches
imetadata.h
Go to the documentation of this file.
1/*
2 * Copyright 2022 Ingemar Hedvall
3 * SPDX-License-Identifier: MIT
4 */
5
12#pragma once
13#include <string>
14#include <vector>
15
16#include "mdf/etag.h"
17#include "mdf/iblock.h"
18
19namespace mdf {
20
27class IMetaData : public IBlock {
28 public:
36void InitMd(const std::string& root_name);
37
43void StringProperty(const std::string& tag, const std::string& value);
44
50 [[nodiscard]] std::string StringProperty(const std::string& tag) const;
51
57void FloatProperty(const std::string& tag, double value);
58
64 [[nodiscard]] double FloatProperty(const std::string& tag) const;
65
70void CommonProperty(const ETag& e_tag);
71
77 [[nodiscard]] ETag CommonProperty(const std::string& name) const;
78
83void CommonProperties(const std::vector<ETag>& tag_list);
84
89 [[nodiscard]] std::vector<ETag> CommonProperties() const;
90
95 [[nodiscard]] std::vector<ETag> Properties() const;
96
101virtual void XmlSnippet(const std::string& text) = 0;
102
107 [[nodiscard]] virtual const std::string& XmlSnippet() const = 0;
108};
109
110} // namespace mdf
Helper class for meta data items in an MDF file.
Definition etag.h:51
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
void InitMd(const std::string &root_name)
Initiate the MD block.
mdf::IMetaData::CommonProperty
void CommonProperty(const ETag &e_tag)
Sets a common property.
mdf::IMetaData::StringProperty
void StringProperty(const std::string &tag, const std::string &value)
Sets a string property in the block.
mdf::IMetaData::CommonProperties
void CommonProperties(const std::vector< ETag > &tag_list)
Sets a number of common properties.
virtual const std::string & XmlSnippet() const =0
Returns the XML string.
void FloatProperty(const std::string &tag, double value)
Sets a float property in the block.
virtual void XmlSnippet(const std::string &text)=0
Stores the XML as a string..
mdf::IMetaData::CommonProperty
ETag CommonProperty(const std::string &name) const
Return a common property.
mdf::IMetaData::CommonProperties
std::vector< ETag > CommonProperties() const
Returns all common properties.
std::vector< ETag > Properties() const
Returns all properties without children.
mdf::IMetaData::StringProperty
std::string StringProperty(const std::string &tag) const
Returns a specific tag value.
double FloatProperty(const std::string &tag) const
Returns a specific tag value.
Simple wrapper around meta data items.
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