Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions Bindings/Python/swig/python_preliminaries.i
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,22 @@ note: ## is a "glue" operator: `a ## b` --> `ab`.
%}
};
%enddef

// Support for pathlib.Path objects
// ================================
%typemap(in) std::string const & (std::string temp, int res = SWIG_OLDOBJ) {
if (PyUnicode_Check($input)) {
temp = std::string(PyUnicode_AsUTF8($input));
$1 = &temp;
} else {
PyObject* fspath = PyOS_FSPath($input);
if (fspath != NULL) {
temp = std::string(PyUnicode_AsUTF8(fspath));
Py_DECREF(fspath);
$1 = &temp;
} else {
PyErr_Clear();
%argument_fail(SWIG_TypeError, "std::string const &", $symname, $argnum);
}
}
}
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,9 @@ performance and stability in wrapping solutions.
- Implemented `generateDecorations()` for `Station` to allow visualization in the Simbody visualizer. (#4169)
- Added `Component::removeComponent` and `Component::extractComponent` methods, which enable removing subcomponents that were previously added via `Component::addComponent` or the `<components>` XML element (#4174).
- Updated required language level to C++20. (#3929)
- Python API accepts Path objects instead of only strings
- Breaking: removed the `operator==` and `operator<` overloads in `ControlLinearNode` and replaced usages with the equivalent utility functions `isEqual()` and `isLessThan()`. (#4095)


v4.5.2
======
- The performance of `getStateVariableValue`, `getStateVariableDerivativeValue`, and `getModelingOption` was improved in
Expand Down