|
OpenTTD Source
14.0-beta3
|
#include "../../stdafx.h"#include "../../debug.h"#include "../../gfx_func.h"#include "../../textbuf_gui.h"#include "../../fileio_func.h"#include <windows.h>#include <fcntl.h>#include <mmsystem.h>#include <regstr.h>#include <shlobj.h>#include <shellapi.h>#include <WinNls.h>#include "win32.h"#include "../../fios.h"#include "../../core/alloc_func.hpp"#include "../../string_func.h"#include <sys/stat.h>#include "../../language.h"#include "../../thread.h"#include "../../library_loader.h"#include "../../safeguards.h"Go to the source code of this file.
Data Structures | |
| struct | DIR |
Macros | |
| #define | NO_SHOBJIDL_SORTDIRECTION |
| #define | SORT_DIGITSASNUMBERS 0x00000008 |
| #define | LINGUISTIC_IGNORECASE 0x00000010 |
Functions | |
| bool | MyShowCursor (bool show, bool toggle) |
| void | ShowOSErrorBox (const char *buf, bool) |
| void | OSOpenBrowser (const std::string &url) |
| static DIR * | dir_calloc () |
| static void | dir_free (DIR *d) |
| DIR * | opendir (const wchar_t *path) |
| struct dirent * | readdir (DIR *d) |
| int | closedir (DIR *d) |
| bool | FiosIsRoot (const std::string &file) |
| void | FiosGetDrives (FileList &file_list) |
| bool | FiosIsValidFile (const std::string &, const struct dirent *ent, struct stat *sb) |
| bool | FiosIsHiddenFile (const struct dirent *ent) |
| std::optional< uint64_t > | FiosGetDiskFreeSpace (const std::string &path) |
| void | CreateConsole () |
| static INT_PTR CALLBACK | HelpDialogFunc (HWND wnd, UINT msg, WPARAM wParam, LPARAM) |
| Callback function to handle the window. | |
| void | ShowInfoI (const std::string &str) |
| char * | getcwd (char *buf, size_t size) |
| void | DetermineBasePaths (const char *exe) |
| std::optional< std::string > | GetClipboardContents () |
| Try to retrieve the current clipboard contents. More... | |
| std::string | FS2OTTD (const std::wstring &name) |
| Convert to OpenTTD's encoding from a wide string. More... | |
| std::wstring | OTTD2FS (const std::string &name) |
| Convert from OpenTTD's encoding to a wide string. More... | |
| char * | convert_from_fs (const wchar_t *name, char *utf8_buf, size_t buflen) |
| Convert to OpenTTD's encoding from that of the environment in UNICODE. More... | |
| wchar_t * | convert_to_fs (const std::string_view name, wchar_t *system_buf, size_t buflen) |
| Convert from OpenTTD's encoding to that of the environment in UNICODE. More... | |
| const char * | GetCurrentLocale (const char *) |
| Determine the current user's locale. | |
| void | Win32SetCurrentLocaleName (std::string iso_code) |
| int | OTTDStringCompare (std::string_view s1, std::string_view s2) |
| int | Win32StringContains (const std::string_view str, const std::string_view value, bool case_insensitive) |
| Search if a string is contained in another string using the current locale. More... | |
| void | SetCurrentThreadName (const char *) |
| Name the thread this function is called on for the debugger. More... | |
Variables | |
| static bool | _has_console |
| static bool | _cursor_disable = true |
| static bool | _cursor_visible = true |
| static DIR | _global_dir |
| static LONG | _global_dir_is_in_use = false |
| static const char * | _help_msg |
| Temporary pointer to get the help message to the window. | |
| std::string | _config_file |
| Configuration file of OpenTTD. | |
| static WCHAR | _cur_iso_locale [16] = L"" |
Implementation of MS Windows system calls
Definition in file win32.cpp.
| char* convert_from_fs | ( | const wchar_t * | name, |
| char * | utf8_buf, | ||
| size_t | buflen | ||
| ) |
Convert to OpenTTD's encoding from that of the environment in UNICODE.
OpenTTD encoding is UTF8, local is wide.
| name | pointer to a valid string that will be converted |
| utf8_buf | pointer to a valid buffer that will receive the converted string |
| buflen | length in characters of the receiving buffer |
| wchar_t* convert_to_fs | ( | const std::string_view | name, |
| wchar_t * | system_buf, | ||
| size_t | buflen | ||
| ) |
Convert from OpenTTD's encoding to that of the environment in UNICODE.
OpenTTD encoding is UTF8, local is wide.
| name | pointer to a valid string that will be converted |
| system_buf | pointer to a valid wide-char buffer that will receive the converted string |
| buflen | length in wide characters of the receiving buffer |
| console_cp | convert to the console encoding instead of the normal system encoding. |
Definition at line 518 of file win32.cpp.
Referenced by HelpDialogFunc(), and HFontFromFont().
| std::string FS2OTTD | ( | const std::wstring & | name | ) |
Convert to OpenTTD's encoding from a wide string.
OpenTTD internal encoding is UTF8.
| name | valid string that will be converted (local, or wide) |
Definition at line 462 of file win32.cpp.
Referenced by NetworkError::AsString(), DLSFile::LoadFile(), and NetworkAddress::Resolve().
| std::optional<std::string> GetClipboardContents | ( | ) |
Try to retrieve the current clipboard contents.
Definition at line 438 of file win32.cpp.
Referenced by Textbuf::InsertClipboard().
| std::wstring OTTD2FS | ( | const std::string & | name | ) |
Convert from OpenTTD's encoding to a wide string.
OpenTTD internal encoding is UTF8.
| name | valid string that will be converted (UTF8) |
| console_cp | convert to the console encoding instead of the normal system encoding. |
Definition at line 479 of file win32.cpp.
Referenced by FileExists(), and IniFile::SaveToDisk().
| void SetCurrentThreadName | ( | const char * | name | ) |
| int Win32StringContains | ( | const std::string_view | str, |
| const std::string_view | value, | ||
| bool | case_insensitive | ||
| ) |
Search if a string is contained in another string using the current locale.
| str | String to search in. |
| value | String to search for. |
| case_insensitive | Search case-insensitive. |
Definition at line 614 of file win32.cpp.
References LibraryLoader::GetFunction().
Referenced by StrNaturalContains(), and StrNaturalContainsIgnoreCase().