Flutter Engine
The 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#ifndef FLUTTER_SHELL_PLATFORM_GLFW_SYSTEM_UTILS_H_
6#define FLUTTER_SHELL_PLATFORM_GLFW_SYSTEM_UTILS_H_
7
8#include <string>
9#include <vector>
10
11#include "flutter/shell/platform/embedder/embedder.h"
12
13namespace flutter {
14
15// Components of a system language/locale.
17 std::string language;
18 std::string territory;
19 std::string codeset;
20 std::string modifier;
21};
22
23// Returns the list of user-preferred languages, in preference order,
24// parsed into LanguageInfo structures.
25std::vector<LanguageInfo> GetPreferredLanguageInfo();
26
27// Converts a vector of LanguageInfo structs to a vector of FlutterLocale
28// structs. |languages| must outlive the returned value, since the returned
29// elements have pointers into it.
30std::vector<FlutterLocale> ConvertToFlutterLocale(
31 const std::vector<LanguageInfo>& languages);
32
33} // namespace flutter
34
35#endif // FLUTTER_SHELL_PLATFORM_GLFW_SYSTEM_UTILS_H_
std::vector< FlutterLocale > ConvertToFlutterLocale(const std::vector< LanguageInfo > &languages)
std::vector< LanguageInfo > GetPreferredLanguageInfo()
std::string language
Definition: system_utils.h:17
std::string modifier
Definition: system_utils.h:20
std::string territory
Definition: system_utils.h:18