OGS
Applications/FileIO/GocadIO/Property.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
6#include <cstddef>
7#include <string>
8
9#include "BaseLib/Logging.h"
10
11namespace FileIO
12{
13namespace Gocad
14{
15struct Property final
16{
17 std::size_t _property_id{};
18 std::string _property_name;
20 std::string _property_unit;
24
25 bool checkID(std::string const& id_string) const
26 {
27 if (_property_id != std::stoul(id_string))
28 {
29 ERR("Expected property id {:d} but found {:d}.",
31 std::stoul(id_string));
32 return false;
33 }
34 return true;
35 }
36
37 std::vector<double> _property_data;
38};
39
40std::ostream& operator<<(std::ostream& os, Property const& p);
41
42Property parseGocadPropertyMetaData(std::string& line, std::istream& in,
43 std::string const& path);
44} // end namespace Gocad
45} // end namespace FileIO
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:40
Property parseGocadPropertyMetaData(std::string &line, std::istream &in, std::string const &path)
std::ostream & operator<<(std::ostream &os, CoordinateSystem const &c)
bool checkID(std::string const &id_string) const