Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

of::filesystem::path with implicit narrow string conversion #8162

Open
wants to merge 87 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 50 commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
3904c2f
ofFilesystemPath
alexandreburton Oct 29, 2024
e667136
auto for native()
alexandreburton Oct 29, 2024
689e1d5
preferred_separator
alexandreburton Oct 29, 2024
48370b4
implicit conv to std::filesystem::path for ofFile and ofDirectory
alexandreburton Oct 29, 2024
2205ad9
const char * implicit conversion
alexandreburton Oct 29, 2024
efc86df
more implicit conversion wstring
alexandreburton Oct 29, 2024
75a6973
operator ==
alexandreburton Oct 29, 2024
118df2e
better handling of const char * implicit conversion
alexandreburton Oct 29, 2024
b35d095
to_narrow_cstr() retry
alexandreburton Oct 29, 2024
1ca4b2f
tweaking #ifdefs
alexandreburton Oct 29, 2024
99bf4d7
tweaking #ifdefs
alexandreburton Oct 29, 2024
598227b
Merge branch 'filesystempath' of https://github.com/artificiel/openFr…
alexandreburton Oct 29, 2024
80c0e0d
rename
alexandreburton Oct 29, 2024
987fb8f
rename
alexandreburton Oct 29, 2024
21f5380
Merge branch 'filesystempath' of https://github.com/artificiel/openFr…
alexandreburton Oct 29, 2024
12fbbb0
more auto (vs #ifdef)
alexandreburton Oct 29, 2024
e338c75
more operator ==
alexandreburton Oct 29, 2024
576fd5c
fix empty() within ofTrueTypeFont
alexandreburton Oct 29, 2024
a8cf688
operator != vs const char *
alexandreburton Oct 29, 2024
446fb58
dir empty()
alexandreburton Oct 29, 2024
678e79e
direct paths
alexandreburton Oct 29, 2024
1e4762c
operator !=
alexandreburton Oct 29, 2024
89ebeef
workaround != with native
alexandreburton Oct 29, 2024
f48532d
explicit split of std::filesystem and of::filesystem::path
alexandreburton Oct 30, 2024
d3b6a44
passes trailing slash
alexandreburton Oct 30, 2024
0391d35
remove extra string conversion
alexandreburton Oct 30, 2024
d9212fc
fix const char * == operator
alexandreburton Oct 30, 2024
3127445
simpler is_absolute()
alexandreburton Oct 30, 2024
0596e81
remove superflous hash
alexandreburton Oct 30, 2024
2769e26
wstring windows-only
alexandreburton Oct 30, 2024
6feadaa
operator != additional
alexandreburton Oct 30, 2024
083b2fa
non-const arg to datapath
alexandreburton Oct 30, 2024
bf09960
non-const .h too
alexandreburton Oct 30, 2024
69cab0f
const other approach
alexandreburton Oct 30, 2024
c8c9ae1
auto for .string() passthrough
alexandreburton Oct 30, 2024
fc25be1
more windows tightening
alexandreburton Oct 30, 2024
e42231e
test tweak
alexandreburton Oct 30, 2024
a1dfba1
auto for generic()
alexandreburton Oct 30, 2024
d765bdf
less const
alexandreburton Oct 30, 2024
0cab869
not native on std::filesystem::path::value_type*()
alexandreburton Oct 30, 2024
3014a1c
u8string
alexandreburton Oct 30, 2024
fea8aa0
operator string_type()
alexandreburton Oct 30, 2024
1e1b84f
more const stuff
alexandreburton Oct 30, 2024
5cadd16
assimpmodelloader to native std::filesystem
alexandreburton Oct 30, 2024
5c43082
missing ()
alexandreburton Oct 30, 2024
b7bdc76
ofxSvg to plain std::filesystem
alexandreburton Oct 30, 2024
3b3d264
more missing ()
alexandreburton Oct 30, 2024
588fdee
tests updated to use native()
alexandreburton Oct 30, 2024
3ae0b18
more tests tweaks with native()
alexandreburton Oct 30, 2024
b669d04
fiddling around replace_extension()
alexandreburton Oct 30, 2024
18068a3
Merge branch 'openframeworks:master' into filesystempath
artificiel Nov 1, 2024
0423bef
add lexically_normal() and _relative()
alexandreburton Nov 2, 2024
7714570
missing u16 u32string()
alexandreburton Nov 2, 2024
bd382fc
better return type for preferred_separator
alexandreburton Nov 2, 2024
585b9c9
perfect forwarding for some methods
alexandreburton Nov 2, 2024
861bcd6
fix return of make_preferred()
alexandreburton Nov 2, 2024
b15717c
fix return of extension()
alexandreburton Nov 2, 2024
b9d1db6
more forwarding
alexandreburton Nov 2, 2024
bef1d92
header guard
alexandreburton Nov 2, 2024
25eacbb
&& for /=
alexandreburton Nov 2, 2024
41d745b
better get_permissions()
alexandreburton Nov 2, 2024
cffcc1a
fix replace_extension return
alexandreburton Nov 2, 2024
92d7769
fix remove filename return
alexandreburton Nov 2, 2024
8b10afd
cleanup
alexandreburton Nov 2, 2024
38d7c11
MARK: and formatting
alexandreburton Nov 2, 2024
3399248
clear()
alexandreburton Nov 3, 2024
ad3bedd
more generic()
alexandreburton Nov 3, 2024
45f46b3
compare()
alexandreburton Nov 3, 2024
b8dd852
lexically_proximate()
alexandreburton Nov 3, 2024
64cf31b
concat()
alexandreburton Nov 3, 2024
5048b87
replace_filename()
alexandreburton Nov 3, 2024
101f477
assign()
alexandreburton Nov 3, 2024
7ade3b4
append()
alexandreburton Nov 3, 2024
2623328
various has_*()
alexandreburton Nov 3, 2024
eaaebd3
various misc()
alexandreburton Nov 3, 2024
b2eeb5d
absolute and canonical not in ::path
alexandreburton Nov 3, 2024
6f3711d
more auto returns
alexandreburton Nov 3, 2024
10dc150
format
alexandreburton Nov 3, 2024
6f53052
noexcept
alexandreburton Nov 3, 2024
e8145c6
consistent naming
alexandreburton Nov 3, 2024
2c35f2f
swap()
alexandreburton Nov 3, 2024
86335ad
comment about return types
alexandreburton Nov 3, 2024
58845cf
integration in ofConstants.h
alexandreburton Nov 3, 2024
0e990ab
correction of file name
alexandreburton Nov 3, 2024
20811e3
ofxTests: ensure std::string a = ofToDataPath("") on windows
alexandreburton Nov 3, 2024
b58632d
Merge branch 'openframeworks:master' into filesystempath
artificiel Nov 3, 2024
5ba2075
Merge branch 'openframeworks:master' into filesystempath
artificiel Nov 6, 2024
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
2 changes: 1 addition & 1 deletion addons/ofxAssimpModelLoader/src/ofxAssimpModelLoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ bool ofxAssimpModelLoader::loadModel(ofBuffer & buffer, bool optimize, const cha
//------------------------------------------
bool ofxAssimpModelLoader::load(const of::filesystem::path & fileName, int assimpOptimizeFlags){
file = ofToDataPath(fileName);
if (!of::filesystem::exists(file)) {
if (!std::filesystem::exists(file)) {
artificiel marked this conversation as resolved.
Show resolved Hide resolved
ofLogVerbose("ofxAssimpModelLoader") << "load(): model does not exist: " << fileName ;
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions addons/ofxSvg/src/ofxSvg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ ofPath & ofxSvg::getPathAt(int n) {
}

void ofxSvg::load(const of::filesystem::path & fileName) {
of::filesystem::path file = ofToDataPath(fileName);
if (!of::filesystem::exists(file)) {
auto file = ofToDataPath(fileName);
if (!std::filesystem::exists(file)) {
ofLogError("ofxSVG") << "load(): path does not exist: " << file ;
return;
}
Expand Down
2 changes: 1 addition & 1 deletion libs/openFrameworks/gl/ofShader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ string ofShader::parseForIncludes(const string & source, vector<of::filesystem::
// --------| invariant: '#pragma include' has been requested

of::filesystem::path includeFS { sourceDirectoryPath / include };
of::filesystem::path includeFSAbsolute { of::filesystem::absolute(includeFS) };
of::filesystem::path includeFSAbsolute { std::filesystem::absolute(includeFS) };

if (std::find(included.begin(), included.end(), includeFSAbsolute) != included.end()) {
ofLogVerbose("ofShader") << include << " already included";
Expand Down
4 changes: 2 additions & 2 deletions libs/openFrameworks/graphics/ofTrueTypeFont.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ static bool loadFontFace(const string & _fontname, FT_Face & face,
auto fontname = _fontname;
auto filename = ofToDataPathFS(fontname);
int fontID = index;
if(!of::filesystem::exists(filename)){
if(!std::filesystem::exists(filename)){
#ifdef TARGET_LINUX
filename = linuxFontPathByName(fontname);
#elif defined(TARGET_OSX)
Expand All @@ -397,7 +397,7 @@ static bool loadFontFace(const string & _fontname, FT_Face & face,
}
filename = winFontPathByName(fontname);
#endif
if(filename == "" ){
if(filename.empty() ){
ofLogError("ofTrueTypeFont") << "loadFontFace(): couldn't find font " << fontname;
return false;
}
Expand Down
5 changes: 1 addition & 4 deletions libs/openFrameworks/utils/ofConstants.h
Original file line number Diff line number Diff line change
Expand Up @@ -443,10 +443,7 @@ typedef TESSindex ofIndexType;
namespace filesystem = std::experimental::filesystem;
}
#else
#include <filesystem>
namespace of {
namespace filesystem = std::filesystem;
}
#include "ofFilesystem.h"
#endif
#else //not OF_USING_STD_FS
// No experimental or c++17 filesytem support use boost
Expand Down
Loading