aboutsummaryrefslogtreecommitdiff
path: root/butl/path
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2016-12-17 15:57:42 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2016-12-17 15:57:42 +0200
commit900a4504d6045071b9bd48bcea206f633f08c681 (patch)
tree119bf28e3f4b761f7ba45e41470d1314f56b4b77 /butl/path
parentdb1ee9aff6e9429e3eb82e67f9d4ece22b7c95ef (diff)
Change path::extension() to return std::string, not C string
The old behaviour (sometimes useful) is provided by extension_cstring().
Diffstat (limited to 'butl/path')
-rw-r--r--butl/path14
1 files changed, 10 insertions, 4 deletions
diff --git a/butl/path b/butl/path
index 726bbe6..064c8aa 100644
--- a/butl/path
+++ b/butl/path
@@ -702,13 +702,19 @@ namespace butl
basic_path
base () const;
- // Return the extension or NULL if not present. If not NULL, then
- // the result points to the character past the dot but it is legal
- // to decrement it once to obtain the value with the dot.
+ // Return the extension or NULL if not present. If not empty, then the
+ // result starts with the character past the dot.
//
- const C*
+ string_type
extension () const;
+ // Return the in-place pointer to extension or NULL if not present. If not
+ // NULL, then the result points to the character past the dot but it is
+ // legal to decrement it once to obtain the value with the dot.
+ //
+ const C*
+ extension_cstring () const;
+
// Return a path relative to the specified path that is equivalent
// to *this. Throws invalid_path if a relative path cannot be derived
// (e.g., paths are on different drives on Windows).