From ab5d5446bfee9190f9130f6dd8e40270fa9dc99e Mon Sep 17 00:00:00 2001 From: "Alexander V. Lukyanov" Date: Tue, 13 Jan 2015 09:12:45 +0300 Subject: [PATCH] (Path::GetDirectory) new method to get directory when is_file is true. --- src/FileAccess.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/FileAccess.h b/src/FileAccess.h index 90c9b0f..821f1d7 100644 --- a/src/FileAccess.h +++ b/src/FileAccess.h @@ -90,6 +90,7 @@ public: void Set(const char *new_path,bool new_is_file=false,const char *new_url=0,int device_prefix_len=0); void SetURL(const char *u) { url.set(u); } void Change(const char *new_path,bool new_is_file=false,const char *new_path_enc=0,int device_prefix_len=0); + const xstring& GetDirectory() const { return is_file?dirname(path):path; } void ExpandTilde(const Path &home); static void Optimize(xstring& p,int dev_prefix=0); void Optimize() { Optimize(path,device_prefix_len); } -- 2.1.0