I ran into this issue when creating a boost::filesystem::path
object (boost v1.55). I couldn't figure out how to create a path from from a String variable, or concatenation of Strings?
//Example 1
namespace fs = boost::filesystem;
String dest = "C:/Users/username";
fs::path destination (dest); //Error here
//Example 2
namespace fs = boost::filesystem;
String user = "username";
fs::path destination ("C:/Users/" + user); //Error here as well.
//Example 3
namespace fs = boost::filesystem;
fs::path destination ("C:/Users/username");
I've only been able to create a path object when the entire string is specified between double quotes like example 3 above, but this does not allow for a variable input.
Basically, how would I implement the fs::path
object class using a String as my starting point?
Thanks for any assistance!
edit
Link to boost/filesystem path documentation. Relearning c++, so a some of it is still a bit over my head... I don't quite understand how the constructor works here... and really don't know what to ask at this point.... I'd definitely appreciate any pointers.