eliminate noexept from our filesystem
because a compiler without filesystem is not C++11 complete anyway We will go with noexeot when we will have std::filesystem...
This commit is contained in:
parent
9fbabadd78
commit
42819c64c2
@ -15,6 +15,13 @@
|
|||||||
|
|
||||||
|
|
||||||
#if defined(_MSC_VER)
|
#if defined(_MSC_VER)
|
||||||
|
#define _SCL_SECURE_NO_WARNINGS
|
||||||
|
#define _CRT_SECURE_NO_DEPRECATE
|
||||||
|
#pragma warning(disable : 4996)
|
||||||
|
#if (_MSC_VER < 1900)
|
||||||
|
// is this a good idea?
|
||||||
|
#define NOT_IMPLEMENTED_KEYWORD_noexcept
|
||||||
|
#endif // _MSC_VER < 1900
|
||||||
#if (_MSC_VER == 1900)
|
#if (_MSC_VER == 1900)
|
||||||
// google: break any code that tries to use codecvt<char16_t> or codecvt<char32_t>.
|
// google: break any code that tries to use codecvt<char16_t> or codecvt<char32_t>.
|
||||||
// google: It appears the C++ libs haven't been compiled with native char16_t/char32_t support.
|
// google: It appears the C++ libs haven't been compiled with native char16_t/char32_t support.
|
||||||
|
|||||||
@ -102,26 +102,26 @@ namespace filesystem
|
|||||||
perms m_prms = perms::unknown;
|
perms m_prms = perms::unknown;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit file_status(file_type ft = file_type::none, perms prms = perms::unknown) noexcept
|
explicit file_status(file_type ft = file_type::none, perms prms = perms::unknown)
|
||||||
:m_ft{ft}, m_prms{prms}
|
:m_ft{ft}, m_prms{prms}
|
||||||
{}
|
{}
|
||||||
|
|
||||||
file_status(const file_status& fs) noexcept: m_ft{fs.m_ft}, m_prms{fs.m_prms}{} // = default;
|
file_status(const file_status& fs) : m_ft{fs.m_ft}, m_prms{fs.m_prms}{} // = default;
|
||||||
file_status(file_status&& fs) noexcept: m_ft{fs.m_ft}, m_prms{fs.m_prms}{} // = default;
|
file_status(file_status&& fs) : m_ft{fs.m_ft}, m_prms{fs.m_prms}{} // = default;
|
||||||
|
|
||||||
~file_status(){};
|
~file_status(){};
|
||||||
file_status& operator=(const file_status&) noexcept = default;
|
file_status& operator=(const file_status&) = default;
|
||||||
file_status& operator=(file_status&&fs) noexcept // = default;
|
file_status& operator=(file_status&&fs) // = default;
|
||||||
{
|
{
|
||||||
m_ft=fs.m_ft; m_prms = fs.m_prms;
|
m_ft=fs.m_ft; m_prms = fs.m_prms;
|
||||||
return *this;
|
return *this;
|
||||||
}
|
}
|
||||||
// observers
|
// observers
|
||||||
file_type type() const noexcept{ return m_ft;}
|
file_type type() const { return m_ft;}
|
||||||
perms permissions() const noexcept{ return m_prms;}
|
perms permissions() const { return m_prms;}
|
||||||
// modifiers
|
// modifiers
|
||||||
void type (file_type ft) noexcept { m_ft=ft ;}
|
void type (file_type ft) { m_ft=ft ;}
|
||||||
void permissions(perms prms) noexcept { m_prms = prms; }
|
void permissions(perms prms) { m_prms = prms; }
|
||||||
};
|
};
|
||||||
|
|
||||||
/// concerned only with lexical and syntactic aspects and does not necessarily exist in
|
/// concerned only with lexical and syntactic aspects and does not necessarily exist in
|
||||||
@ -174,8 +174,8 @@ namespace filesystem
|
|||||||
|
|
||||||
//file_status status() const;
|
//file_status status() const;
|
||||||
|
|
||||||
operator const path&() const noexcept{return m_path;};
|
operator const path&() const {return m_path;};
|
||||||
const path& path() const noexcept{return m_path;}
|
const path& path() const {return m_path;}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -219,8 +219,8 @@ namespace filesystem
|
|||||||
|
|
||||||
|
|
||||||
// enable directory_iterator range-based for statements
|
// enable directory_iterator range-based for statements
|
||||||
directory_iterator begin( ) noexcept { return *this; }
|
directory_iterator begin( ) { return *this; }
|
||||||
directory_iterator end( ) noexcept { return {}; }
|
directory_iterator end( ) { return {}; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
template<typename Char>
|
template<typename Char>
|
||||||
@ -405,7 +405,7 @@ namespace filesystem
|
|||||||
// file_status status(const path& p);
|
// file_status status(const path& p);
|
||||||
bool file_attrib(const nana::string& file, attribute&);
|
bool file_attrib(const nana::string& file, attribute&);
|
||||||
|
|
||||||
inline bool is_directory(file_status s) noexcept{ return s.type() == file_type::directory ;}
|
inline bool is_directory(file_status s) { return s.type() == file_type::directory ;}
|
||||||
inline bool is_directory(const path& p) { return directory_iterator{ p }->attr.directory; }//works??
|
inline bool is_directory(const path& p) { return directory_iterator{ p }->attr.directory; }//works??
|
||||||
inline bool is_directory(const directory_entry& d) { return d.attr.directory; }
|
inline bool is_directory(const directory_entry& d) { return d.attr.directory; }
|
||||||
//bool is_directory(const path& p, error_code& ec) noexcept;
|
//bool is_directory(const path& p, error_code& ec) noexcept;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user