| 1 | #include <iostream>
|
|---|
| 2 | #include <boost/filesystem.hpp>
|
|---|
| 3 |
|
|---|
| 4 | using namespace std;
|
|---|
| 5 | using namespace boost::filesystem;
|
|---|
| 6 |
|
|---|
| 7 | static void gvDisplayPath(const char* apDescription, const char* apPath)
|
|---|
| 8 | {
|
|---|
| 9 | path vPath(apPath);
|
|---|
| 10 | vPath.make_preferred();
|
|---|
| 11 |
|
|---|
| 12 | cout
|
|---|
| 13 | << apDescription << ":" << endl
|
|---|
| 14 | << endl
|
|---|
| 15 | << " generic_string = \"" << vPath.generic_string() << "\"" << endl
|
|---|
| 16 | << " native = " << vPath.native() << endl;
|
|---|
| 17 |
|
|---|
| 18 | cout << endl;
|
|---|
| 19 | }
|
|---|
| 20 |
|
|---|
| 21 | int main()
|
|---|
| 22 | {
|
|---|
| 23 | gvDisplayPath("Current directory path", current_path().string().c_str());
|
|---|
| 24 | gvDisplayPath("Parent of current directory path", current_path().remove_filename().string().c_str());
|
|---|
| 25 |
|
|---|
| 26 | return 0;
|
|---|
| 27 | }
|
|---|