Skip to content

Instantly share code, notes, and snippets.

@moebiussurfing
Last active April 22, 2020 04:39
Show Gist options
  • Save moebiussurfing/4f7ecdac5aa65c894771e26bdc2abc76 to your computer and use it in GitHub Desktop.
Save moebiussurfing/4f7ecdac5aa65c894771e26bdc2abc76 to your computer and use it in GitHub Desktop.
openFrameworks - file path handling with boost
//split string path using boost
//https://stackoverflow.com/questions/10099206/howto-parse-a-path-to-a-vector-using-c
//boost::filesystem::path p1("/usr/local/bin");
boost::filesystem::path p1(videoFilePath.get());
//boost::filesystem::path p2("c:\\");
std::cout << p1.filename() << std::endl; // prints "bin"
std::cout << p1.parent_path() << std::endl; // prints "/usr/local"
videoName = ofToString(p1.filename());
filename: "NightmoVES4.mov"
parent_path: "C:\_DATA"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment