59 void Name(
const std::string& name) { name_ = name; }
65 [[nodiscard]]
const std::string&
Name()
const {
return name_; }
77 [[nodiscard]]
const std::string&
Description()
const {
return desc_; }
83 void Unit(
const std::string& unit) { unit_ = unit; }
89 [[nodiscard]]
const std::string&
Unit()
const {
return unit_; }
96 void UnitRef(
const std::string& unit_ref) { unit_ref_ = unit_ref; }
102 [[nodiscard]]
const std::string&
UnitRef()
const {
return unit_ref_; }
114 void Type(
const std::string& type) { type_ = type; }
121 [[nodiscard]]
const std::string&
Type()
const {
return type_; }
128 void Language(
const std::string& language) { language_ = language; }
134 [[nodiscard]]
const std::string&
Language()
const {
return language_; }
140 void ReadOnly(
bool read_only) { read_only_ = read_only; }
146 [[nodiscard]]
bool ReadOnly()
const {
return read_only_; }
167 template <
typename T>
168 void Value(
const T& value);
175 template <
typename T>
176 [[nodiscard]] T
Value()
const;
190 [[nodiscard]]
const std::vector<ETag>&
TreeList()
const {
return tree_list_; }
196 std::string unit_ref_;
198 std::string language_;
200 bool read_only_ =
false;
201 int creator_index_ = -1;
203 std::vector<ETag> tree_list_;
208 std::ostringstream temp;
223 if (!value_.empty()) {
224 std::istringstream temp(value_);
Helper class for meta data items in an MDF file.
Definition etag.h:51
void UnitRef(const std::string &unit_ref)
Reference unit.
Definition etag.h:96
void CreatorIndex(int index)
Index to FH block.
Definition etag.h:154
bool ReadOnly() const
Indicates that the value is read-only.
Definition etag.h:146
ETagDataType DataType() const
Retuns the data type.
int CreatorIndex() const
Index to file history block.
Definition etag.h:160
const std::string & Type() const
Data type of the value.
Definition etag.h:121
const std::string & Unit() const
Unit of value.
Definition etag.h:89
T Value() const
Returns the tag value.
Definition etag.h:221
void Language(const std::string &language)
Language of the value.
Definition etag.h:128
const std::string & Name() const
Returns the name attribute.
Definition etag.h:65
void AddTag(const ETag &tag)
Adds a tag and define this to be a list of tags (tree).
const std::vector< ETag > & TreeList() const
Return a list of tags.
Definition etag.h:190
void Description(const std::string &desc)
Optional attribute in an e-tag or tree-tag.
Definition etag.h:71
void ReadOnly(bool read_only)
The value is read-only.
Definition etag.h:140
void Type(const std::string &type)
Data type of the value.
Definition etag.h:114
const std::string & UnitRef() const
Reference unit.
Definition etag.h:102
const std::string & Description() const
Description text.
Definition etag.h:77
void DataType(ETagDataType type)
Sets the data type.
void Unit(const std::string &unit)
Optional unit of the value in a nn e-tag..
Definition etag.h:83
const std::string & Language() const
Language code.
Definition etag.h:134
void Name(const std::string &name)
Sets the name attribute in an e-tag or a tree-tag.
Definition etag.h:59
Main namespace for the MDF library.
Definition canmessage.h:17
ETagDataType
The e-tag may optional have a data type below. The value in the XML file is of course string but the ...
Definition etag.h:29
@ TimeType
Time value ISO.
@ DecimalType
Decimal value (use float instead)
@ DateType
Date value according to ISO (YYYY-MM-DD).
@ BooleanType
Boolean tru/false value.
@ DateTimeType
Date and Time ISO string (YYYY-MM-DD hh:mm:ss)
@ FloatType
Floating point value.
@ IntegerType
Integer value.