mirror of https://github.com/swig/swig
Add forward class definition for std::filesystem::path class
The namespace is missing for the path class, so this provides more type information to fix this problem. Closes #2993
This commit is contained in:
parent
cb0d31f6c9
commit
5ac5d90f97
|
@ -7,6 +7,9 @@ the issue number to the end of the URL: https://github.com/swig/swig/issues/
|
|||
Version 4.3.0 (in progress)
|
||||
===========================
|
||||
|
||||
2024-08-19: wsfulton
|
||||
[Python] #2993 Add missing std::filesystem namespace to std_filesystem.i.
|
||||
|
||||
2024-08-17: olly
|
||||
#904 #1907 #2579 Fix string literal and character literal wrapping bugs.
|
||||
|
||||
|
|
|
@ -58,7 +58,8 @@ std::string pathPtrToStr(const std::filesystem::path * p) {
|
|||
return p->string();
|
||||
}
|
||||
|
||||
std::filesystem::path roundTrip(const std::filesystem::path& p) {
|
||||
namespace stdfs = std::filesystem;
|
||||
std::filesystem::path roundTrip(const stdfs::path& p) {
|
||||
return p;
|
||||
}
|
||||
%}
|
||||
|
|
|
@ -8,6 +8,12 @@
|
|||
#include <filesystem>
|
||||
%}
|
||||
|
||||
namespace std {
|
||||
namespace filesystem {
|
||||
class path;
|
||||
}
|
||||
}
|
||||
|
||||
%fragment("SWIG_std_filesystem", "header") {
|
||||
SWIGINTERN PyObject *SWIG_std_filesystem_importPathClass() {
|
||||
PyObject *module = PyImport_ImportModule("pathlib");
|
||||
|
|
Loading…
Reference in New Issue