From 67aabb1dca0ce7a4d8c62c07f0784132410fd63a Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Tue, 23 Aug 2016 14:41:38 +0200 Subject: Add path::to_directory() predicate --- butl/path | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'butl/path') 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 -- cgit v1.1