diff options
author | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2019-10-22 16:01:02 +0100 |
---|---|---|
committer | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2020-02-24 09:36:04 +0000 |
commit | a15e8d92ea2ebc20abd54a7ecaa406f8e0de0c66 (patch) | |
tree | b6976d0de881cab39ea673061eaed90bc7e64c36 /src/libcamera/include/utils.h | |
parent | a8be6e94e79f602d543a15afd44ef60e378b138f (diff) |
libcamera: utils: Add a C++ dirname implementation
Provide a std::string based implementation which conforms to the
behaviour of the dirname() fucntion defined by POSIX.
Tests are added to cover expected corner cases of the implementation.
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/libcamera/include/utils.h')
-rw-r--r-- | src/libcamera/include/utils.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libcamera/include/utils.h b/src/libcamera/include/utils.h index 080ea661..94059776 100644 --- a/src/libcamera/include/utils.h +++ b/src/libcamera/include/utils.h @@ -33,6 +33,7 @@ namespace utils { const char *basename(const char *path); char *secure_getenv(const char *name); +std::string dirname(const std::string &path); template<class InputIt1, class InputIt2> unsigned int set_overlap(InputIt1 first1, InputIt1 last1, |