How to build a full path string (safely) from separate strings?

后端 未结 7 1299
失恋的感觉
失恋的感觉 2020-12-08 12:34

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

7条回答
  •  眼角桃花
    2020-12-08 13:09

    If you want to do this with Qt, you can use QFileInfo constructor:

    QFileInfo fi( QDir("/tmp"), "file" );
    QString path = fi.absoluteFilePath();
    

提交回复
热议问题