Skip to content

Commit c7879c9

Browse files
authored
more fs::path port (#8104)
1 parent 47583f6 commit c7879c9

18 files changed

+29
-28
lines changed

libs/openFrameworks/app/ofAppGLFWWindow.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ void ofAppGLFWWindow::setup(const ofGLESWindowSettings & settings) {
409409

410410
#ifdef TARGET_LINUX
411411
//------------------------------------------------------------
412-
void ofAppGLFWWindow::setWindowIcon(const std::string & path) {
412+
void ofAppGLFWWindow::setWindowIcon(const of::filesystem::path & path) {
413413
ofPixels iconPixels;
414414
ofLoadImage(iconPixels, path);
415415
setWindowIcon(iconPixels);

libs/openFrameworks/app/ofAppGLFWWindow.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ class ofAppGLFWWindow : public ofAppBaseGLWindow {
166166
Window getX11Window();
167167
XIC getX11XIC();
168168

169-
void setWindowIcon(const std::string & path);
169+
void setWindowIcon(const of::filesystem::path & path);
170170
void setWindowIcon(const ofPixels & iconPixels);
171171
#endif
172172

libs/openFrameworks/graphics/ofGraphicsCairo.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ static void ofEndSaveScreen(){
2727

2828
}
2929

30-
static void ofBeginSaveScreen(std::string filename, ofCairoRenderer::Type type, bool bMultipage, bool b3D, ofRectangle outputsize){
30+
static void ofBeginSaveScreen(const of::filesystem::path & filename, ofCairoRenderer::Type type, bool bMultipage, bool b3D, ofRectangle outputsize){
3131
if( bScreenShotStarted ) ofEndSaveScreen();
3232

3333
storedRenderer = ofGetCurrentRenderer();
@@ -45,7 +45,7 @@ static void ofBeginSaveScreen(std::string filename, ofCairoRenderer::Type type,
4545
}
4646

4747
//-----------------------------------------------------------------------------------
48-
void ofBeginSaveScreenAsPDF(std::string filename, bool bMultipage, bool b3D, ofRectangle outputsize){
48+
void ofBeginSaveScreenAsPDF(const of::filesystem::path & filename, bool bMultipage, bool b3D, ofRectangle outputsize){
4949
ofBeginSaveScreen(filename, ofCairoRenderer::PDF, bMultipage, b3D, outputsize);
5050
}
5151

@@ -55,7 +55,7 @@ void ofEndSaveScreenAsPDF(){
5555
}
5656

5757
//-----------------------------------------------------------------------------------
58-
void ofBeginSaveScreenAsSVG(std::string filename, bool bMultipage, bool b3D, ofRectangle outputsize){
58+
void ofBeginSaveScreenAsSVG(const of::filesystem::path & filename, bool bMultipage, bool b3D, ofRectangle outputsize){
5959
ofBeginSaveScreen(filename, ofCairoRenderer::SVG, bMultipage, b3D, outputsize);
6060
}
6161

libs/openFrameworks/graphics/ofGraphicsCairo.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,15 +24,15 @@
2424
/// ~~~~
2525
/// \sa End drawing with ofEndSaveScreenAsPDF()
2626
///
27-
void ofBeginSaveScreenAsPDF(std::string filename, bool bMultipage = false, bool b3D = false, ofRectangle outputsize = ofRectangle(0,0,0,0));
27+
void ofBeginSaveScreenAsPDF(const of::filesystem::path & filename, bool bMultipage = false, bool b3D = false, ofRectangle outputsize = ofRectangle(0,0,0,0));
2828

2929
/// \brief Terminates draw to PDF through ofCairoRenderer and outputs the file.
3030
/// \sa ofBeginSaveScreenAsPDF()
3131
void ofEndSaveScreenAsPDF();
3232

3333
/// \brief Begin rendering to a SVG file.
3434
/// \sa ofEndSaveScreenAsSVG(), ofBeginSaveScreenAsPDF()
35-
void ofBeginSaveScreenAsSVG(std::string filename, bool bMultipage = false, bool b3D = false, ofRectangle outputsize = ofRectangle(0,0,0,0));
35+
void ofBeginSaveScreenAsSVG(const of::filesystem::path & filename, bool bMultipage = false, bool b3D = false, ofRectangle outputsize = ofRectangle(0,0,0,0));
3636

3737
/// \brief Terminates draw to SVG and outputs the file.
3838
/// \sa ofBeginSaveScreenAsSVG()

libs/openFrameworks/graphics/ofImage.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -410,7 +410,7 @@ bool ofLoadImage(ofTexture & tex, const ofBuffer & buffer, const ofImageLoadSett
410410

411411
//----------------------------------------------------------------
412412
template<typename PixelType>
413-
static bool saveImage(const ofPixels_<PixelType> & _pix, const of::filesystem::path& _fileName, ofImageQualityType qualityLevel) {
413+
static bool saveImage(const ofPixels_<PixelType> & _pix, const of::filesystem::path & _fileName, ofImageQualityType qualityLevel) {
414414
ofInitFreeImage();
415415
if (_pix.isAllocated() == false){
416416
ofLogError("ofImage") << "saveImage(): couldn't save " << _fileName << ", pixels are not allocated";
@@ -797,7 +797,7 @@ bool ofImage_<PixelType>::load(const of::filesystem::path & fileName, const ofIm
797797

798798
//----------------------------------------------------------
799799
template<typename PixelType>
800-
bool ofImage_<PixelType>::loadImage(const std::string& fileName){
800+
bool ofImage_<PixelType>::loadImage(const of::filesystem::path & fileName){
801801
return load(fileName);
802802
}
803803

@@ -838,7 +838,7 @@ bool ofImage_<PixelType>::save(ofBuffer & buffer, ofImageFormat imageFormat, ofI
838838

839839
//----------------------------------------------------------
840840
template<typename PixelType>
841-
void ofImage_<PixelType>::saveImage(const std::string& fileName, ofImageQualityType qualityLevel) const {
841+
void ofImage_<PixelType>::saveImage(const of::filesystem::path & fileName, ofImageQualityType qualityLevel) const {
842842
save(fileName, qualityLevel);
843843
}
844844

libs/openFrameworks/graphics/ofImage.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ class ofImage_ : public ofBaseImage_<PixelType>{
227227
bool load(const ofBuffer & buffer, const ofImageLoadSettings &settings = ofImageLoadSettings());
228228

229229
[[deprecated("Use load")]]
230-
bool loadImage(const std::string& fileName);
230+
bool loadImage(const of::filesystem::path & fileName);
231231
[[deprecated("Use load")]]
232232
bool loadImage(const ofBuffer & buffer);
233233
[[deprecated("Use load")]]
@@ -616,7 +616,7 @@ class ofImage_ : public ofBaseImage_<PixelType>{
616616
bool save(ofBuffer & buffer, ofImageFormat imageFormat = OF_IMAGE_FORMAT_PNG, ofImageQualityType compressionLevel = OF_IMAGE_QUALITY_BEST) const;
617617

618618
[[deprecated("Use save")]]
619-
void saveImage(const std::string& fileName, ofImageQualityType compressionLevel = OF_IMAGE_QUALITY_BEST) const;
619+
void saveImage(const of::filesystem::path & fileName, ofImageQualityType compressionLevel = OF_IMAGE_QUALITY_BEST) const;
620620
[[deprecated("Use save")]]
621621
void saveImage(ofBuffer & buffer, ofImageQualityType compressionLevel = OF_IMAGE_QUALITY_BEST) const;
622622
[[deprecated("Use save")]]

libs/openFrameworks/graphics/ofTrueTypeFont.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -613,7 +613,7 @@ void ofTrueTypeFont::reloadTextures(){
613613
}
614614

615615
//-----------------------------------------------------------
616-
bool ofTrueTypeFont::loadFont(string filename, int fontSize, bool bAntiAliased, bool bFullCharacterSet, bool makeContours, float simplifyAmt, int dpi) {
616+
bool ofTrueTypeFont::loadFont(const of::filesystem::path & filename, int fontSize, bool bAntiAliased, bool bFullCharacterSet, bool makeContours, float simplifyAmt, int dpi) {
617617
return load(filename, fontSize, bAntiAliased, bFullCharacterSet, makeContours, simplifyAmt, dpi);
618618
}
619619

@@ -689,7 +689,7 @@ ofTrueTypeFont::glyph ofTrueTypeFont::loadGlyph(uint32_t utf8) const{
689689
}
690690

691691
//-----------------------------------------------------------
692-
bool ofTrueTypeFont::load(const of::filesystem::path& filename, int fontSize, bool antialiased, bool fullCharacterSet, bool makeContours, float simplifyAmt, int dpi) {
692+
bool ofTrueTypeFont::load(const of::filesystem::path & filename, int fontSize, bool antialiased, bool fullCharacterSet, bool makeContours, float simplifyAmt, int dpi) {
693693

694694
ofTrueTypeFontSettings settings(filename,fontSize);
695695
settings.antialiased = antialiased;

libs/openFrameworks/graphics/ofTrueTypeFont.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ class ofTrueTypeFont {
204204
int dpi = 0);
205205

206206
[[deprecated("Use load")]]
207-
bool loadFont(std::string filename, int fontsize, bool _bAntiAliased = true, bool _bFullCharacterSet = false, bool makeContours = false, float simplifyAmt = 0.0f, int dpi = 0);
207+
bool loadFont(const of::filesystem::path & filename, int fontsize, bool _bAntiAliased = true, bool _bFullCharacterSet = false, bool makeContours = false, float simplifyAmt = 0.0f, int dpi = 0);
208208

209209
bool load(const ofTrueTypeFontSettings & settings);
210210

libs/openFrameworks/sound/ofAVEngineSoundPlayer.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1018,7 +1018,7 @@ - (float)soundDurationSeconds{
10181018
unload();
10191019
}
10201020

1021-
string filePath = ofToDataPath(fileName);
1021+
auto filePath = ofToDataPath(fileName);
10221022
@autoreleasepool {
10231023
soundPlayer = [[AVEnginePlayer alloc] init];
10241024
}

libs/openFrameworks/sound/ofMediaFoundationSoundPlayer.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ ofMediaFoundationSoundPlayer::~ofMediaFoundationSoundPlayer() {
190190
bool ofMediaFoundationSoundPlayer::load(const of::filesystem::path& fileName, bool stream) {
191191
unload();
192192

193+
// FIXME: wstring?
193194
std::string fileStr = ofPathToString(fileName);
194195
bool bStream = false;
195196
bStream = bStream || ofIsStringInString(fileStr, "http://");

0 commit comments

Comments
 (0)