Appending to boost::filesystem::path

后端 未结 5 1281
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-05 00:53

I have a certain boost::filesystem::path in hand and I\'d like to append a string (or path) to it.

boost::filesystem::path p(\"c:\\\\dir\");
p.appen         


        
5条回答
  •  自闭症患者
    2021-02-05 01:31

    With Version 3 of Filesytem library (Boost 1.55.0) it's as easy as just

    boost::filesystem::path p("one_path");
    p += "_and_another_one";
    

    resulting in p = "one_path_and_another_one".

提交回复
热议问题