mirror of
https://github.com/boostorg/filesystem.git
synced 2026-02-01 08:32:08 +00:00
For all path_traits convert() and dispatch() functions provide two overloads, one with a "const codecvt_type&" argument, and one without. The overload without a codecvt argument calls path::codecvt() iff a conversion actually needs to be performed. Change all uses of path_traits convert() and dispatch() functions call the appropriate overload, rather than calling with path::codecvt() as a default. This limits the impact of locale("") initialization failures on Linux and other non-BSD POSIX systems to programs that actually depend on locale(""). It further ensures that exceptions thrown as a result of such failures occur after main() has started, and so can be caught.
This commit is contained in:
@@ -185,8 +185,15 @@ namespace filesystem
|
||||
|
||||
# ifdef BOOST_WINDOWS_API
|
||||
|
||||
const std::string path::generic_string() const
|
||||
{
|
||||
path tmp(*this);
|
||||
std::replace(tmp.m_pathname.begin(), tmp.m_pathname.end(), L'\\', L'/');
|
||||
return tmp.string();
|
||||
}
|
||||
|
||||
const std::string path::generic_string(const codecvt_type& cvt) const
|
||||
{
|
||||
{
|
||||
path tmp(*this);
|
||||
std::replace(tmp.m_pathname.begin(), tmp.m_pathname.end(), L'\\', L'/');
|
||||
return tmp.string(cvt);
|
||||
|
||||
Reference in New Issue
Block a user