Skip to content
Snippets Groups Projects
Commit 52f06611 authored by Dmitri Naumov's avatar Dmitri Naumov
Browse files

[MPL] Move implementation in own TU.

parent 6a043200
No related branches found
No related tags found
No related merge requests found
/**
* \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
*/
#include "PropertyType.h"
#include <boost/algorithm/string/predicate.hpp>
#include "BaseLib/Error.h"
namespace MaterialPropertyLib
{
PropertyType convertStringToProperty(std::string const& string)
{
for (int i = 0; i < static_cast<int>(PropertyType::number_of_properties);
++i)
{
if (boost::iequals(string, property_enum_to_string[i]))
{
return static_cast<PropertyType>(i);
}
}
OGS_FATAL(
"The property name '{:s}' does not correspond to any known property",
string);
}
} // namespace MaterialPropertyLib
......@@ -13,12 +13,9 @@
#pragma once
#include <array>
#include <boost/algorithm/string/predicate.hpp>
#include <memory>
#include <string>
#include "BaseLib/Error.h"
namespace MaterialPropertyLib
{
class Property;
......@@ -167,21 +164,7 @@ static const std::array<std::string, PropertyType::number_of_properties>
/// This function converts a string (e.g. a string from the configuration-tree)
/// into one of the entries of the PropertyType enumerator.
inline PropertyType convertStringToProperty(std::string const& string)
{
for (int i = 0; i < static_cast<int>(PropertyType::number_of_properties);
++i)
{
if (boost::iequals(string, property_enum_to_string[i]))
{
return static_cast<PropertyType>(i);
}
}
OGS_FATAL(
"The property name '{:s}' does not correspond to any known property",
string);
}
PropertyType convertStringToProperty(std::string const& string);
/// This data type is based on a std::array. It can hold pointers to objects of
/// class Property or its inheritors. The size of this array is determined by
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment