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:
|
||||
include:
|
||||
- env: CXX=g++-5 CC=gcc-5
|
||||
- env: CXX=g++-8
|
||||
addons:
|
||||
apt:
|
||||
packages:
|
||||
- g++-5
|
||||
- g++-8
|
||||
- libjpeg8-dev
|
||||
- libpng-dev
|
||||
- libasound2-dev
|
||||
@ -21,7 +21,7 @@ matrix:
|
||||
- libx11-dev
|
||||
- libxft-dev
|
||||
- libxcursor-dev
|
||||
sources:
|
||||
sources:
|
||||
- ubuntu-toolchain-r-test
|
||||
|
||||
allow_failures:
|
||||
@ -44,7 +44,7 @@ matrix:
|
||||
|
||||
before_install:
|
||||
- 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"
|
||||
|
||||
#- 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 parent_path() const;
|
||||
path filename() const;
|
||||
//path stem() const;
|
||||
path stem() const;
|
||||
path extension() const;
|
||||
|
||||
// query
|
||||
|
@ -225,8 +225,10 @@ namespace nana { namespace experimental { namespace filesystem
|
||||
//Because of No wide character version of POSIX
|
||||
#if defined(NANA_POSIX)
|
||||
const char* separators = "/";
|
||||
const char* punt = ".";
|
||||
#else
|
||||
const wchar_t* separators = L"/\\";
|
||||
const wchar_t* punt = L".";
|
||||
#endif
|
||||
|
||||
//class file_status
|
||||
@ -453,6 +455,22 @@ namespace nana { namespace experimental { namespace filesystem
|
||||
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
|
||||
{
|
||||
pathstr_.clear();
|
||||
|
@ -1359,7 +1359,7 @@ namespace nana
|
||||
path.resize(len);
|
||||
|
||||
impl_->path = to_utf8(path);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -1589,7 +1589,7 @@ namespace nana
|
||||
};
|
||||
|
||||
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