OGS
Property.h
Go to the documentation of this file.
1
10#pragma once
11
12#include <cstddef>
13#include <string>
14
15#include "BaseLib/Logging.h"
16
17namespace FileIO
18{
19namespace Gocad
20{
21struct Property final
22{
23 std::size_t _property_id{};
24 std::string _property_name;
26 std::string _property_unit;
30
31 bool checkID(std::string const& id_string) const
32 {
33 if (_property_id != std::stoul(id_string))
34 {
35 ERR("Expected property id {:d} but found {:d}.",
37 std::stoul(id_string));
38 return false;
39 }
40 return true;
41 }
42
43 std::vector<double> _property_data;
44};
45
46std::ostream& operator<<(std::ostream& os, Property const& p);
47
48Property parseGocadPropertyMetaData(std::string& line, std::istream& in,
49 std::string const& path);
50} // end namespace Gocad
51} // end namespace FileIO
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:45
Property parseGocadPropertyMetaData(std::string &line, std::istream &in, std::string const &path)
Definition Property.cpp:30
std::ostream & operator<<(std::ostream &os, CoordinateSystem const &c)
double _property_no_data_value
Definition Property.h:29
std::string _property_data_fname
Definition Property.h:28
std::string _property_class_name
Definition Property.h:25
bool checkID(std::string const &id_string) const
Definition Property.h:31
std::string _property_unit
Definition Property.h:26
std::string _property_name
Definition Property.h:24
std::size_t _property_id
Definition Property.h:23
std::string _property_data_type
Definition Property.h:27
std::vector< double > _property_data
Definition Property.h:43