mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 02:02:22 +00:00
Begin to implement IfcConvert enhancements discussed in #20. Remove C++-specific getters and setters and use the same set() and get() functions in in both C++ and Python. Enhance output of IfcConvert, especially in error situations (spamming a hundred lines of options always hides the original error message), utilize Boost's foreach macro to provide cleaner iteration code.
This commit is contained in:
@@ -17,12 +17,14 @@
|
||||
* *
|
||||
********************************************************************************/
|
||||
|
||||
#include "IfcUtil.h"
|
||||
#include "../ifcparse/IfcException.h"
|
||||
|
||||
#include <boost/algorithm/string/replace.hpp>
|
||||
|
||||
#include <iostream>
|
||||
#include <algorithm>
|
||||
|
||||
#include "../ifcparse/IfcException.h"
|
||||
|
||||
#include "IfcUtil.h"
|
||||
|
||||
void IfcEntityList::push(IfcUtil::IfcBaseClass* l) {
|
||||
if (l) {
|
||||
@@ -143,4 +145,14 @@ bool IfcUtil::valid_binary_string(const std::string& s) {
|
||||
if (*it != '0' && *it != '1') return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
boost::regex IfcUtil::wildcard_string_to_regex(std::string str)
|
||||
{
|
||||
std::string special_chars = "\\^.$|()[]*+";
|
||||
foreach(char c, special_chars) {
|
||||
std::string char_str(1, c);
|
||||
boost::replace_all(str, char_str, "\\"+ char_str);
|
||||
}
|
||||
return boost::regex(str);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user