refactor(Core/Common): restyle tools with astyle (#3706)

This commit is contained in:
Kargatum
2020-11-17 16:59:58 +07:00
committed by GitHub
parent 0bee5af962
commit 7f26c9ddad
28 changed files with 269 additions and 272 deletions

View File

@@ -360,7 +360,7 @@ size_t utf8length(std::string& utf8str)
{
return utf8::distance(utf8str.c_str(), utf8str.c_str() + utf8str.size());
}
catch(std::exception const&)
catch (std::exception const&)
{
utf8str.clear();
return 0;
@@ -382,7 +382,7 @@ void utf8truncate(std::string& utf8str, size_t len)
char* oend = utf8::utf16to8(wstr.c_str(), wstr.c_str() + wstr.size(), &utf8str[0]);
utf8str.resize(oend - (&utf8str[0])); // remove unused tail
}
catch(std::exception const&)
catch (std::exception const&)
{
utf8str.clear();
}
@@ -397,7 +397,7 @@ bool Utf8toWStr(char const* utf8str, size_t csize, wchar_t* wstr, size_t& wsize)
wsize -= out.remaining(); // remaining unused space
wstr[wsize] = L'\0';
}
catch(std::exception const&)
catch (std::exception const&)
{
// Replace the converted string with an error message if there is enough space
// Otherwise just return an empty string
@@ -429,7 +429,7 @@ bool Utf8toWStr(const std::string& utf8str, std::wstring& wstr)
{
utf8::utf8to16(utf8str.c_str(), utf8str.c_str() + utf8str.size(), std::back_inserter(wstr));
}
catch(std::exception const&)
catch (std::exception const&)
{
wstr.clear();
return false;
@@ -452,7 +452,7 @@ bool WStrToUtf8(wchar_t* wstr, size_t size, std::string& utf8str)
}
utf8str = utf8str2;
}
catch(std::exception const&)
catch (std::exception const&)
{
utf8str.clear();
return false;
@@ -475,7 +475,7 @@ bool WStrToUtf8(std::wstring const& wstr, std::string& utf8str)
}
utf8str = utf8str2;
}
catch(std::exception const&)
catch (std::exception const&)
{
utf8str.clear();
return false;