add path conversion functions
This commit is contained in:
parent
a2a7d1fc37
commit
7d7cce8d2a
@ -162,6 +162,10 @@ namespace filesystem
|
|||||||
const value_type*c_str() const;
|
const value_type*c_str() const;
|
||||||
const string_type& native() const;
|
const string_type& native() const;
|
||||||
operator string_type() const;
|
operator string_type() const;
|
||||||
|
|
||||||
|
std::string string() const;
|
||||||
|
std::wstring wstring() const;
|
||||||
|
std::string u8string() const;
|
||||||
private:
|
private:
|
||||||
void _m_assign(const std::string& source_utf8);
|
void _m_assign(const std::string& source_utf8);
|
||||||
void _m_assign(const std::wstring& source);
|
void _m_assign(const std::wstring& source);
|
||||||
|
|||||||
@ -173,6 +173,21 @@ namespace nana { namespace experimental {
|
|||||||
return native();
|
return native();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
std::string path::string() const
|
||||||
|
{
|
||||||
|
return to_osmbstr(to_utf8(pathstr_));
|
||||||
|
}
|
||||||
|
|
||||||
|
std::wstring path::wstring() const
|
||||||
|
{
|
||||||
|
return to_wstring(pathstr_);
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string path::u8string() const
|
||||||
|
{
|
||||||
|
return to_utf8(pathstr_);
|
||||||
|
}
|
||||||
|
|
||||||
void path::_m_assign(const std::string& source_utf8)
|
void path::_m_assign(const std::string& source_utf8)
|
||||||
{
|
{
|
||||||
#if defined(NANA_WINDOWS)
|
#if defined(NANA_WINDOWS)
|
||||||
|
|||||||
@ -84,7 +84,7 @@ namespace nana{ namespace paint
|
|||||||
|
|
||||||
bool open(const nana::experimental::filesystem::path& filename) override
|
bool open(const nana::experimental::filesystem::path& filename) override
|
||||||
{
|
{
|
||||||
std::ifstream ifs(filename.c_str(), std::ios::binary);
|
std::ifstream ifs(filename.string(), std::ios::binary);
|
||||||
if(ifs)
|
if(ifs)
|
||||||
{
|
{
|
||||||
ifs.seekg(0, std::ios::end);
|
ifs.seekg(0, std::ios::end);
|
||||||
|
|||||||
@ -263,7 +263,7 @@ namespace paint
|
|||||||
//Check for BMP
|
//Check for BMP
|
||||||
if (!helper)
|
if (!helper)
|
||||||
{
|
{
|
||||||
std::ifstream ifs(file.c_str(), std::ios::binary);
|
std::ifstream ifs(file.string(), std::ios::binary);
|
||||||
if (ifs)
|
if (ifs)
|
||||||
{
|
{
|
||||||
unsigned short meta = 0;
|
unsigned short meta = 0;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user