mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-17 14:02:27 +00:00
This commit is contained in:
@@ -520,10 +520,17 @@ static IfcUtil::ArgumentType helper_fn_attribute_type(const IfcUtil::IfcBaseClas
|
|||||||
// The IfcFile* returned by open() is to be freed by SWIG/Python
|
// The IfcFile* returned by open() is to be freed by SWIG/Python
|
||||||
%newobject open;
|
%newobject open;
|
||||||
%newobject read;
|
%newobject read;
|
||||||
|
|
||||||
#ifdef WITH_IFCXML
|
|
||||||
%newobject parse_ifcxml;
|
%newobject parse_ifcxml;
|
||||||
|
|
||||||
|
%inline %{
|
||||||
|
IfcParse::IfcFile* parse_ifcxml(const std::string& fn) {
|
||||||
|
#ifdef WITH_IFCXML
|
||||||
|
return IfcParse::parse_ifcxml(fn);
|
||||||
|
#else
|
||||||
|
throw std::runtime_error("No IfcXML support enabled");
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
%}
|
||||||
|
|
||||||
%inline %{
|
%inline %{
|
||||||
IfcParse::IfcFile* open(const std::string& fn) {
|
IfcParse::IfcFile* open(const std::string& fn) {
|
||||||
@@ -531,12 +538,6 @@ static IfcUtil::ArgumentType helper_fn_attribute_type(const IfcUtil::IfcBaseClas
|
|||||||
return f;
|
return f;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WITH_IFCXML
|
|
||||||
IfcParse::IfcFile* parse_ifcxml(const std::string& fn) {
|
|
||||||
return IfcParse::parse_ifcxml(fn);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
IfcParse::IfcFile* read(const std::string& data) {
|
IfcParse::IfcFile* read(const std::string& data) {
|
||||||
char* copiedData = new char[data.length()];
|
char* copiedData = new char[data.length()];
|
||||||
memcpy(copiedData, data.c_str(), data.length());
|
memcpy(copiedData, data.c_str(), data.length());
|
||||||
|
|||||||
Reference in New Issue
Block a user