fix coding standard violations
This commit is contained in:
parent
d4e5d604a5
commit
7d81035e14
3 changed files with 9 additions and 9 deletions
|
|
@ -63,7 +63,7 @@ namespace fc {
|
||||||
It is needed since not all parts of fc library accept unicode paths
|
It is needed since not all parts of fc library accept unicode paths
|
||||||
(fc::file_mapping).
|
(fc::file_mapping).
|
||||||
*/
|
*/
|
||||||
std::string toNativeAnsiPath() const;
|
std::string to_native_ansi_path() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief replaces '/' with '\' in the result of generic_string()
|
* @brief replaces '/' with '\' in the result of generic_string()
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
namespace fc {
|
namespace fc {
|
||||||
void to_variant( const fc::path& t, variant& v ) {
|
void to_variant( const fc::path& t, variant& v ) {
|
||||||
std::string path = t.toNativeAnsiPath();
|
std::string path = t.to_native_ansi_path();
|
||||||
for(auto& c : path)
|
for(auto& c : path)
|
||||||
{
|
{
|
||||||
if(c == '\\')
|
if(c == '\\')
|
||||||
|
|
@ -96,16 +96,16 @@ namespace fc {
|
||||||
return _p->generic_wstring();
|
return _p->generic_wstring();
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string path::toNativeAnsiPath() const
|
std::string path::to_native_ansi_path() const
|
||||||
{
|
{
|
||||||
std::wstring path = generic_wstring();
|
std::wstring path = generic_wstring();
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
const size_t maxPath = 32*1024;
|
const size_t maxPath = 32*1024;
|
||||||
std::vector<wchar_t> shortPath;
|
std::vector<wchar_t> short_path;
|
||||||
shortPath.resize(maxPath + 1);
|
short_path.resize(maxPath + 1);
|
||||||
|
|
||||||
wchar_t* buffer = shortPath.data();
|
wchar_t* buffer = short_path.data();
|
||||||
DWORD res = GetShortPathNameW(path.c_str(), buffer, maxPath);
|
DWORD res = GetShortPathNameW(path.c_str(), buffer, maxPath);
|
||||||
if(res != 0)
|
if(res != 0)
|
||||||
path = buffer;
|
path = buffer;
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ namespace fc
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
std::string filePath = file.toNativeAnsiPath();
|
std::string filePath = file.to_native_ansi_path();
|
||||||
|
|
||||||
_file_mapping.reset( new fc::file_mapping( filePath.c_str(), fc::read_write ) );
|
_file_mapping.reset( new fc::file_mapping( filePath.c_str(), fc::read_write ) );
|
||||||
_mapped_region.reset( new fc::mapped_region( *_file_mapping, fc::read_write, 0, s ) );
|
_mapped_region.reset( new fc::mapped_region( *_file_mapping, fc::read_write, 0, s ) );
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue