Skip to content
Snippets Groups Projects
Commit be36b183 authored by Andreas Schenk's avatar Andreas Schenk
Browse files

fixed string to vec converter for info module

parent 785299a8
No related branches found
No related tags found
No related merge requests found
......@@ -195,6 +195,10 @@ inline Vec3 operator/(Real d, const Vec3& v)
return nrvo;
}
// The following operator is among other things used to write vector
// data into info files. If its format is changed, the string to
// vector type cast in item_type_cast.hh has to be changed
// accordingly.
inline std::ostream& operator<<(std::ostream& os, const Vec3& v)
{
os << "[" << v.x << ", " << v.y << ", " << v.z << "]";
......
......@@ -99,7 +99,7 @@ template <> void set_new_type<IT_STRING,IT_BOOL>(EleImpl& item)
template <> void set_new_type<IT_STRING,IT_VECTOR>(EleImpl& item)
{
static String num("[-+]?[0-9]*\\.?[0-9]+([eE][-+]?[0-9]+)?");
boost::regex expression("\\(("+num+"),("+num+"),("+num+")\\)");
boost::regex expression("\\[ *("+num+") *, *("+num+") *, *("+num+") *\\]");
boost::cmatch what;
if(boost::regex_match(item.GetStringRepr().c_str(), what, expression)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment