aboutsummaryrefslogtreecommitdiff
path: root/butl/path
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-07-30 16:36:53 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-07-30 16:36:53 +0200
commite37cf91f24fc409fa0aa84500245f57c685fc8ea (patch)
tree2c0730f6c4226b054cb5eaf640fd0bb704536dae /butl/path
parent6597c9b777b608a96974b4a7a8c15234b05ffdd8 (diff)
Implement support for Windows path actualization
Diffstat (limited to 'butl/path')
-rw-r--r--butl/path23
1 files changed, 17 insertions, 6 deletions
diff --git a/butl/path b/butl/path
index 4a80b9b..8148b00 100644
--- a/butl/path
+++ b/butl/path
@@ -239,10 +239,14 @@ namespace butl
realize (string_type&);
#endif
- private:
+ // Utilities.
+ //
#ifdef _WIN32
static C
tolower (C);
+
+ static C
+ toupper (C);
#endif
};
@@ -716,13 +720,20 @@ namespace butl
reverse_iterator rend () const {return reverse_iterator (begin ());}
public:
- // Normalize the path. This includes collapsing the '.' and '..'
- // directories if possible, collapsing multiple directory separators, and
- // converting all directory separators to the canonical form. Return
- // *this.
+ // Normalize the path and return*this. Normalization involves collapsing
+ // the '.' and '..' directories if possible, collapsing multiple
+ // directory separators, and converting all directory separators to the
+ // canonical form.
+ //
+ // If actual is true, then for case-insensitive filesystems obtain the
+ // actual spelling of the path. Only an absolute path can be actualized.
+ // If a path component does not exist, then its (and all subsequent)
+ // spelling is unchanged. This is a potentially expensive operation.
+ // Normally one can assume that "well-known" directories (current, home,
+ // etc.) are returned in their actual spelling.
//
basic_path&
- normalize ();
+ normalize (bool actual = false);
// Make the path absolute using the current directory unless it is already
// absolute. Return *this.