Merge branch 'master' into develop

This commit is contained in:
Jinhao
2016-02-16 23:50:45 +08:00
13 changed files with 341 additions and 114 deletions

View File

@@ -38,6 +38,7 @@
namespace nana { namespace experimental {
inline namespace v1 {
namespace filesystem
{
//class filesystem_error
@@ -249,7 +250,24 @@ namespace nana { namespace experimental {
{
return to_utf8(pathstr_);
}
std::string path::generic_string() const
{
auto str = string();
std::replace(str.begin(), str.end(), '\\', '/');
return str;
}
std::wstring path::generic_wstring() const
{
auto str = wstring();
std::replace(str.begin(), str.end(), L'\\', L'/');
return str;
}
std::string path::generic_u8string() const // uppss ...
{
auto str = pathstr_;
std::replace(str.begin(), str.end(), '\\', '/'); // uppss ... revise this !!!!!
return to_utf8(str);
}
path & path::operator/=(const path& p)
{
if (p.empty())
@@ -634,7 +652,7 @@ namespace nana { namespace experimental {
auto stat = status(p, err);
if (err != std::error_code())
throw filesystem_error("nana::filesystem::status", p, err);
throw filesystem_error("nana::experimental::filesystem::status", p, err);
return stat;
}
@@ -852,6 +870,7 @@ namespace nana { namespace experimental {
::chdir(p.c_str());
#endif
}
} //end namespace v1
}//end namespace filesystem
} //end namespace experimental
}//end namespace nana

View File

@@ -142,7 +142,7 @@ namespace nana
auto path = path_.caption();
auto root = path.substr(0, path.find('/'));
if(root == "HOME")
path.replace(0, 4, nana::filesystem::path_user().native());
path.replace(0, 4, nana::experimental::filesystem::path_user().native());
else if(root == "FILESYSTEM")
path.erase(0, 10);
else
@@ -344,7 +344,7 @@ namespace nana
else
dir = saved_selected_path;
_m_load_cat_path(dir.size() ? dir : nana::filesystem::path_user().native());
_m_load_cat_path(dir.size() ? dir : nana::experimental::filesystem::path_user().native());
tb_file_.caption(file_with_path_removed);
}
@@ -474,7 +474,7 @@ namespace nana
{
auto begstr = path.substr(0, pos);
if(begstr == "FS.HOME")
path.replace(0, 7, nana::filesystem::path_user().native());
path.replace(0, 7, nana::experimental::filesystem::path_user().native());
else
path.erase(0, pos);
return begstr;
@@ -508,13 +508,13 @@ namespace nana
{
m.bytes = fs::file_size(path + m.name);
m.directory = fs::is_directory(fattr);
::nana::filesystem::modified_file_time(path + m.name, m.modified_time);
::nana::experimental::filesystem::modified_file_time(path + m.name, m.modified_time);
}
else
{
m.bytes = 0;
m.directory = fs::is_directory(*i);
::nana::filesystem::modified_file_time(path + i->path().filename().native(), m.modified_time);
::nana::experimental::filesystem::modified_file_time(path + i->path().filename().native(), m.modified_time);
}
file_container_.push_back(m);
@@ -534,7 +534,7 @@ namespace nana
while(!beg_node.empty() && (beg_node != nodes_.home) && (beg_node != nodes_.filesystem))
beg_node = beg_node.owner();
auto head = nana::filesystem::path_user().native();
auto head = nana::experimental::filesystem::path_user().native();
if(path.size() >= head.size() && (path.substr(0, head.size()) == head))
{//This is HOME
path_.caption("HOME");

View File

@@ -103,7 +103,7 @@ namespace nana{
delete impl_->radio_logic;
}
group& group::add_option(std::string text)
checkbox& group::add_option(std::string text)
{
_THROW_IF_EMPTY()
@@ -118,7 +118,7 @@ namespace nana{
if (impl_->radio_logic)
impl_->radio_logic->add(*opt);
return *this;
return *impl_->options.back();
}
group& group::radio_mode(bool enable)