Skip to content
This repository

stop using strings for file path manipulation #1560

ofTheo opened this Issue · 5 comments

5 participants

Theodore Watson Christoph Buchner ofZach arturo Elliot Woods
Theodore Watson

This is sort of a global issue and is being partly addressed by @elliotwoods 's PR for ofDataPath #1523

We should refrain from doing string manipulation on paths and use poco path for everything but actually passing the path to the loader/saver/manipulator .

Christoph Buchner

How does that look in the PG? this could possibly reduce the various headaches with paths and double // etc in the PG, right?


this would be a big help for the PG and avoid some headaches. in particular, copyFromTo has been problematic, but overall, I think using a smarter object and avoiding string manipulation everywhere will be a big win.


some days ago i changed ofFile and ofDirectory so their comparison operators return the correct value even for different paths if they are actually pointing to the same thing:

ofFile f1("img.png");
ofFile f2("../data/img.png");

will return true. Poco comparison operators actually don't work for something like that

Elliot Woods

@arturoc - unless we resolve absolute paths for equality


yes that's what i did for ofFile and ofDirectory, we should add similar constructors, methods and operators for ofFilePath though, since ofFile actually opens the file

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.