Commit dd7a4f11 by maarten

Terug naar boost::regex

git-svn-id: svn+ssh://gitlab/srv/svn-repos/pdb-redo/trunk@408 a1961a4f-ab94-4bcc-80e8-33b5a54de466
parent d1b3f08d
...@@ -5,9 +5,9 @@ ...@@ -5,9 +5,9 @@
#include <boost/filesystem/path.hpp> #include <boost/filesystem/path.hpp>
//// the std regex of gcc is crashing.... //// the std regex of gcc is crashing....
//#include <boost/regex.hpp> #include <boost/regex.hpp>
#include <regex> // #include <regex>
#include <set> #include <set>
namespace cif namespace cif
...@@ -40,7 +40,7 @@ struct ValidateType ...@@ -40,7 +40,7 @@ struct ValidateType
{ {
std::string mName; std::string mName;
DDL_PrimitiveType mPrimitiveType; DDL_PrimitiveType mPrimitiveType;
std::regex mRx; boost::regex mRx;
bool operator<(const ValidateType& rhs) const bool operator<(const ValidateType& rhs) const
{ {
......
...@@ -312,7 +312,7 @@ class CompoundFactory ...@@ -312,7 +312,7 @@ class CompoundFactory
static CompoundFactory* sInstance; static CompoundFactory* sInstance;
struct CompoundFactoryImpl* mImpl; class CompoundFactoryImpl* mImpl;
}; };
} }
...@@ -1030,7 +1030,7 @@ bool DictParser::collectItemTypes() ...@@ -1030,7 +1030,7 @@ bool DictParser::collectItemTypes()
try try
{ {
ValidateType v = { ValidateType v = {
code, mapToPrimitiveType(primitiveCode), regex(construct, regex::extended | regex::optimize) code, mapToPrimitiveType(primitiveCode), boost::regex(construct, boost::regex::extended | boost::regex::optimize)
}; };
mValidator.addTypeValidator(move(v)); mValidator.addTypeValidator(move(v));
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>
//// since gcc's regex is crashing.... //// since gcc's regex is crashing....
//#include <boost/regex.hpp> #include <boost/regex.hpp>
#include <regex> // #include <regex>
#include "cif++/Cif++.h" #include "cif++/Cif++.h"
#include "cif++/CifParser.h" #include "cif++/CifParser.h"
...@@ -162,7 +162,7 @@ void ValidateItem::operator()(string value) const ...@@ -162,7 +162,7 @@ void ValidateItem::operator()(string value) const
{ {
if (not value.empty() and value != "?" and value != ".") if (not value.empty() and value != "?" and value != ".")
{ {
if (mType != nullptr and not regex_match(value, mType->mRx)) if (mType != nullptr and not boost::regex_match(value, mType->mRx))
throw ValidationError(mCategory->mName, mTag, "Value '" + value + "' does not match type expression for type " + mType->mName); throw ValidationError(mCategory->mName, mTag, "Value '" + value + "' does not match type expression for type " + mType->mName);
if (not mEnums.empty()) if (not mEnums.empty())
...@@ -219,7 +219,7 @@ const ValidateType* Validator::getValidatorForType(string typeCode) const ...@@ -219,7 +219,7 @@ const ValidateType* Validator::getValidatorForType(string typeCode) const
{ {
const ValidateType* result = nullptr; const ValidateType* result = nullptr;
auto i = mTypeValidators.find(ValidateType{ typeCode, ptChar, regex() }); auto i = mTypeValidators.find(ValidateType{ typeCode, ptChar, boost::regex() });
if (i != mTypeValidators.end()) if (i != mTypeValidators.end())
result = &*i; result = &*i;
else if (VERBOSE > 4) else if (VERBOSE > 4)
......
...@@ -675,7 +675,7 @@ vector<tuple<string,string>> Compound::mapToIsomer(const Compound& c) const ...@@ -675,7 +675,7 @@ vector<tuple<string,string>> Compound::mapToIsomer(const Compound& c) const
if (not check) if (not check)
throw runtime_error("Compounds " + id() + " and " + c.id() + " are not isomers in call to mapToIsomer"); throw runtime_error("Compounds " + id() + " and " + c.id() + " are not isomers in call to mapToIsomer");
return move(result); return result;
} }
vector<string> Compound::isomers() const vector<string> Compound::isomers() const
......
...@@ -221,7 +221,7 @@ struct AtomImpl ...@@ -221,7 +221,7 @@ struct AtomImpl
if (not mRow["pdbx_formal_charge"].empty()) if (not mRow["pdbx_formal_charge"].empty())
{ {
int charge = mRow["pdbx_formal_charge"].as<int>(); int charge = mRow["pdbx_formal_charge"].as<int>();
if (abs(charge > 1)) if (abs(charge) > 1)
element += to_string(charge); element += to_string(charge);
if (charge < 0) if (charge < 0)
element += '-'; element += '-';
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment