mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
format: reformat project
Signed-off-by: Vyacheslav Ivanov <islavaivanov76@gmail.com>
This commit is contained in:
parent
736cd175d5
commit
bbf33e8e4d
202 changed files with 7389 additions and 5609 deletions
|
|
@ -1,11 +1,12 @@
|
|||
#include "platform.hpp"
|
||||
|
||||
#include "../typedefs.hpp"
|
||||
|
||||
#include <sstream>
|
||||
#include <iomanip>
|
||||
#include <time.h>
|
||||
|
||||
#include <iomanip>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
|
||||
#include "../typedefs.hpp"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <Windows.h>
|
||||
|
|
@ -20,22 +21,30 @@ void platform::configure_encoding() {
|
|||
|
||||
std::string platform::detect_locale() {
|
||||
LCID lcid = GetThreadLocale();
|
||||
wchar_t preferredLocaleName[LOCALE_NAME_MAX_LENGTH];//locale name format: ll-CC
|
||||
if (LCIDToLocaleName(lcid, preferredLocaleName, LOCALE_NAME_MAX_LENGTH, 0) == 0) {
|
||||
std::cerr << "error in platform::detect_locale! LCIDToLocaleName failed." << std::endl;
|
||||
wchar_t preferredLocaleName[LOCALE_NAME_MAX_LENGTH]; // locale name format:
|
||||
// ll-CC
|
||||
if (LCIDToLocaleName(
|
||||
lcid, preferredLocaleName, LOCALE_NAME_MAX_LENGTH, 0
|
||||
) == 0) {
|
||||
std::cerr
|
||||
<< "error in platform::detect_locale! LCIDToLocaleName failed."
|
||||
<< std::endl;
|
||||
}
|
||||
//ll_CC format
|
||||
return util::wstr2str_utf8(preferredLocaleName).replace(2, 1, "_").substr(0, 5);
|
||||
// ll_CC format
|
||||
return util::wstr2str_utf8(preferredLocaleName)
|
||||
.replace(2, 1, "_")
|
||||
.substr(0, 5);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void platform::configure_encoding(){
|
||||
void platform::configure_encoding() {
|
||||
}
|
||||
|
||||
std::string platform::detect_locale() {
|
||||
std::string programLocaleName = setlocale(LC_ALL, nullptr);
|
||||
std::string preferredLocaleName = setlocale(LC_ALL, ""); //locale name format: ll_CC.encoding
|
||||
std::string preferredLocaleName =
|
||||
setlocale(LC_ALL, ""); // locale name format: ll_CC.encoding
|
||||
setlocale(LC_ALL, programLocaleName.c_str());
|
||||
|
||||
return preferredLocaleName.substr(0, 5);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue