swh:1:snp:6088ab52ef49920e01e3f334cdf4d5d6c8a822b9
Raw File
Tip revision: 29a30e11c8a53e1c367886d1a3b965ad2aecdc35 authored by garibay-j on 20 October 2021, 17:23:08 UTC
Merge branch 'SurfaceMoles' into 'master'
Tip revision: 29a30e1
Property.h
/**
 * \file
 * \copyright
 * Copyright (c) 2012-2021, OpenGeoSys Community (http://www.opengeosys.org)
 *            Distributed under a Modified BSD License.
 *              See accompanying file LICENSE.txt or
 *              http://www.opengeosys.org/project/license
 */

#pragma once

#include <cstddef>
#include <string>

#include "BaseLib/Logging.h"

namespace FileIO
{
namespace Gocad
{
struct Property final
{
    std::size_t _property_id{};
    std::string _property_name;
    std::string _property_class_name;
    std::string _property_unit;
    std::string _property_data_type;
    std::string _property_data_fname;
    double _property_no_data_value{};

    bool checkID(std::string const& id_string) const
    {
        if (_property_id != std::stoul(id_string))
        {
            ERR("Expected property id {:d} but found {:d}.",
                _property_id,
                std::stoul(id_string));
            return false;
        }
        return true;
    }

    std::vector<double> _property_data;
};

std::ostream& operator<<(std::ostream& os, Property const& p);

Property parseGocadPropertyMetaData(std::string& line, std::istream& in,
                                    std::string const& path);
}  // end namespace Gocad
}  // end namespace FileIO
back to top