Add more idiomatic wrapper wrapper

This commit is contained in:
Thomas Krijnen
2014-06-20 14:18:29 +02:00
parent 0a7b1dd7f4
commit 8851641d94
3 changed files with 47 additions and 90 deletions
+7 -6
View File
@@ -33,13 +33,14 @@
%ignore operator<<;
%rename("by_type") EntitiesByType;
%rename("get_argument_count") getArgumentCount;
%rename("__len__") getArgumentCount;
%rename("get_argument_type") getArgumentType;
%rename("get_argument_name") getArgumentName;
%rename("get_argument_index") getArgumentIndex;
%rename("_set_argument") setArgument;
%rename("__repr__") toString;
%rename("Entity") IfcUntypedEntity;
%rename("entity_instance") IfcUntypedEntity;
%rename("file") IfcFile;
%typemap(typecheck,precedence=SWIG_TYPECHECK_INTEGER) IfcEntities {
$1 = (PySequence_Check($input) && !PyUnicode_Check($input) && !PyString_Check($input)) ? 1 : 0;
@@ -150,7 +151,7 @@
}
}
%module IfcImport %{
%module ifc_wrapper %{
#include "../ifcparse/IfcException.h"
#include "Interface.h"
using namespace IfcParse;
@@ -181,7 +182,7 @@
}
namespace std {
%template(Ints) vector<int>;
%template(Doubles) vector<double>;
%template(Strings) vector<string>;
%template(ints) vector<int>;
%template(doubles) vector<double>;
%template(strings) vector<string>;
};
+1 -1
View File
@@ -76,7 +76,7 @@ namespace IfcParse {
std::string _author_email;
std::string _author_organisation;
public:
IfcParse::IfcSpfStream* file;
IfcParse::IfcSpfStream* stream;
IfcParse::Tokens* tokens;
bool Init(const std::string& fn);
IfcEntities EntitiesByType(const std::string& t);