mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-18 22:33:33 +00:00
Add a stream2_from_string() (mostly for wasm)
This commit is contained in:
@@ -708,6 +708,7 @@ private:
|
||||
%newobject open;
|
||||
%newobject read;
|
||||
%newobject parse_ifcxml;
|
||||
%newobject stream_from_string;
|
||||
|
||||
%inline %{
|
||||
IfcParse::IfcFile* open(const std::string& fn, bool readonly=false) {
|
||||
@@ -728,6 +729,12 @@ private:
|
||||
return f;
|
||||
}
|
||||
|
||||
IfcParse::InstanceStreamer* stream_from_string(const std::string& data) {
|
||||
char* copiedData = new char[data.length()];
|
||||
memcpy(copiedData, data.c_str(), data.length());
|
||||
return new IfcParse::InstanceStreamer((void *)copiedData, data.length());
|
||||
}
|
||||
|
||||
const char* version() {
|
||||
return IFCOPENSHELL_VERSION;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user