replace string parameter of image's constructor with filesystem::path

This commit is contained in:
Jinhao
2015-11-30 00:58:29 +08:00
parent c86a00bea5
commit b35f293b9e
11 changed files with 103 additions and 67 deletions

View File

@@ -82,15 +82,9 @@ namespace nana{ namespace paint
return false;
}
bool open(const nana::char_t* filename) override
bool open(const nana::experimental::filesystem::path& filename) override
{
if(nullptr == filename) return false;
std::ifstream ifs;
#if defined(NANA_UNICODE)
ifs.open(static_cast<std::string>(nana::charset(filename)).c_str(), std::ios::binary);
#else
ifs.open(filename, std::ios::binary);
#endif
std::ifstream ifs(filename.c_str(), std::ios::binary);
if(ifs)
{
ifs.seekg(0, std::ios::end);

View File

@@ -23,7 +23,7 @@ namespace nana{ namespace paint
image_ico(bool is_ico);
bool open(const nana::char_t* filename) override;
bool open(const ::nana::experimental::filesystem::path& filename) override;
bool open(const void* data, std::size_t bytes) override;
bool alpha_channel() const override;
bool empty() const override;