Flutter Engine
system_utils.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 // This file contains utilities for system-level information/settings.
6 
7 #ifndef FLUTTER_SHELL_PLATFORM_WINDOWS_SYSTEM_UTILS_H_
8 #define FLUTTER_SHELL_PLATFORM_WINDOWS_SYSTEM_UTILS_H_
9 
10 #include <string>
11 #include <vector>
12 
13 namespace flutter {
14 
15 // Components of a system language/locale.
16 struct LanguageInfo {
17  std::string language;
18  std::string region;
19  std::string script;
20 };
21 
22 // Returns the list of user-preferred languages, in preference order,
23 // parsed into LanguageInfo structures.
24 std::vector<LanguageInfo> GetPreferredLanguageInfo();
25 
26 // Returns the list of user-preferred languages, in preference order.
27 // The language names are as described at:
28 // https://docs.microsoft.com/en-us/windows/win32/intl/language-names
29 std::vector<std::wstring> GetPreferredLanguages();
30 
31 // Parses a Windows language name into its components.
32 LanguageInfo ParseLanguageName(std::wstring language_name);
33 
34 } // namespace flutter
35 
36 #endif // FLUTTER_SHELL_PLATFORM_WINDOWS_SYSTEM_UTILS_H_
std::string language
Definition: system_utils.h:17
std::vector< std::wstring > GetPreferredLanguages()
LanguageInfo ParseLanguageName(std::wstring language_name)
std::vector< LanguageInfo > GetPreferredLanguageInfo()