Does C++ have any equivalent to python\'s function os.path.join? Basically, I\'m looking for something that combines two (or more) parts of a file path so that
os.path.join
With C++11 and Qt you can do this:
QString join(const QString& v) { return v; } template<typename... Args> QString join(const QString& first, Args... args) { return QDir(first).filePath(join(args...)); }
Usage:
QString path = join("/tmp", "dir", "file"); // /tmp/dir/file