Merge branch 'folderbox_weakly_canonical' of https://github.com/qPCR4vir/nana into qPCR4vir-folderbox_weakly_canonical
This commit is contained in:
commit
71e3f9de80
@ -8,11 +8,11 @@ cache:
|
|||||||
|
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- env: CXX=g++-5 CC=gcc-5
|
- env: CXX=g++-8
|
||||||
addons:
|
addons:
|
||||||
apt:
|
apt:
|
||||||
packages:
|
packages:
|
||||||
- g++-5
|
- g++-8
|
||||||
- libjpeg8-dev
|
- libjpeg8-dev
|
||||||
- libpng-dev
|
- libpng-dev
|
||||||
- libasound2-dev
|
- libasound2-dev
|
||||||
@ -44,7 +44,7 @@ matrix:
|
|||||||
|
|
||||||
before_install:
|
before_install:
|
||||||
- cd ..
|
- cd ..
|
||||||
- git clone --depth=1 --branch=cmake-dev https://github.com/qPCR4vir/nana-demo.git nana-demo
|
- git clone --depth=1 --branch=hotfix https://github.com/qPCR4vir/nana-demo.git nana-demo
|
||||||
- export PATH="$HOME/bin:$PATH"
|
- export PATH="$HOME/bin:$PATH"
|
||||||
|
|
||||||
#- mkdir ~/bin #it seemd that a bin already exists from 20170901
|
#- mkdir ~/bin #it seemd that a bin already exists from 20170901
|
||||||
|
@ -254,7 +254,7 @@ namespace nana { namespace experimental { namespace filesystem
|
|||||||
path relative_path() const;
|
path relative_path() const;
|
||||||
path parent_path() const;
|
path parent_path() const;
|
||||||
path filename() const;
|
path filename() const;
|
||||||
//path stem() const;
|
path stem() const;
|
||||||
path extension() const;
|
path extension() const;
|
||||||
|
|
||||||
// query
|
// query
|
||||||
|
@ -225,8 +225,10 @@ namespace nana { namespace experimental { namespace filesystem
|
|||||||
//Because of No wide character version of POSIX
|
//Because of No wide character version of POSIX
|
||||||
#if defined(NANA_POSIX)
|
#if defined(NANA_POSIX)
|
||||||
const char* separators = "/";
|
const char* separators = "/";
|
||||||
|
const char* punt = ".";
|
||||||
#else
|
#else
|
||||||
const wchar_t* separators = L"/\\";
|
const wchar_t* separators = L"/\\";
|
||||||
|
const wchar_t* punt = L".";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//class file_status
|
//class file_status
|
||||||
@ -453,6 +455,22 @@ namespace nana { namespace experimental { namespace filesystem
|
|||||||
return{ pathstr_ };
|
return{ pathstr_ };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
path path::stem() const
|
||||||
|
{
|
||||||
|
auto pos = pathstr_.find_last_of(separators);
|
||||||
|
auto ext = pathstr_.find_last_of(punt);
|
||||||
|
|
||||||
|
if (pos == pathstr_.npos)
|
||||||
|
pos = 0;
|
||||||
|
else
|
||||||
|
pos++;
|
||||||
|
|
||||||
|
if (ext == pathstr_.npos || ext < pos)
|
||||||
|
return path(pathstr_.substr(pos));
|
||||||
|
else
|
||||||
|
return path(pathstr_.substr(pos, ext-pos));
|
||||||
|
}
|
||||||
|
|
||||||
void path::clear() noexcept
|
void path::clear() noexcept
|
||||||
{
|
{
|
||||||
pathstr_.clear();
|
pathstr_.clear();
|
||||||
|
@ -1589,7 +1589,7 @@ namespace nana
|
|||||||
};
|
};
|
||||||
|
|
||||||
folderbox::folderbox(window owner, const path_type& init_path, std::string title)
|
folderbox::folderbox(window owner, const path_type& init_path, std::string title)
|
||||||
: impl_(new implement{ owner, fs::canonical(init_path).make_preferred(), title, false})
|
: impl_(new implement{ owner, fs::weakly_canonical(init_path).make_preferred(), title, false})
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user