aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-08-23 14:41:38 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-08-23 14:47:25 +0200
commit67aabb1dca0ce7a4d8c62c07f0784132410fd63a (patch)
tree07693d3bc4e23c9c677891bcf5ff46363a7cce12
parentc443044ce146aee249722f662573e3b81c00d884 (diff)
Add path::to_directory() predicate
-rw-r--r--butl/path6
1 files changed, 6 insertions, 0 deletions
diff --git a/butl/path b/butl/path
index 967afe7..aafc2aa 100644
--- a/butl/path
+++ b/butl/path
@@ -549,6 +549,12 @@ namespace butl
bool
root () const;
+ // Test, based on the presence/absence of the trailing separator, if the
+ // path is to a directory.
+ //
+ bool
+ to_directory () const {return this->tsep_ != 0;}
+
// Return true if *this is a sub-path of the specified path (i.e.,
// the specified path is a prefix). Expects both paths to be
// normalized. Note that this function returns true if the paths