TGUI  0.8-dev
Global.hpp
1 //
3 // TGUI - Texus' Graphical User Interface
4 // Copyright (C) 2012-2017 Bruno Van de Velde (vdv_b@tgui.eu)
5 //
6 // This software is provided 'as-is', without any express or implied warranty.
7 // In no event will the authors be held liable for any damages arising from the use of this software.
8 //
9 // Permission is granted to anyone to use this software for any purpose,
10 // including commercial applications, and to alter it and redistribute it freely,
11 // subject to the following restrictions:
12 //
13 // 1. The origin of this software must not be misrepresented;
14 // you must not claim that you wrote the original software.
15 // If you use this software in a product, an acknowledgment
16 // in the product documentation would be appreciated but is not required.
17 //
18 // 2. Altered source versions must be plainly marked as such,
19 // and must not be misrepresented as being the original software.
20 //
21 // 3. This notice may not be removed or altered from any source distribution.
22 //
24 
25 #ifndef TGUI_GLOBAL_HPP
26 #define TGUI_GLOBAL_HPP
27 
29 
30 #include <TGUI/Config.hpp>
31 #include <string>
32 
34 
36 namespace tgui
37 {
42  TGUI_API void enableTabKeyUsage();
43 
44 
49  TGUI_API void disableTabKeyUsage();
50 
51 
60  TGUI_API void setResourcePath(const std::string& path);
61 
62 
71  TGUI_API const std::string& getResourcePath();
72 
73 
76  // Checks if two floats are equal, with regard to a small epsilon margin.
78  TGUI_API bool compareFloats(float x, float y);
79 
80 
83  // Checks if a character is a whitespace character.
85  TGUI_API bool isWhitespace(char character);
86 
87 
90  // Converts a string to an integer. Acts like std::stoi which isn't supported in MinGW TDM.
92  TGUI_API int stoi(const std::string& value);
93 
94 
97  // Converts a string to a float. Acts like std::stof which isn't supported in MinGW TDM.
99  TGUI_API float stof(const std::string& value);
100 
101 
104  // Extracts a bool from a string value.
106  TGUI_API bool extractBoolFromString(const std::string& property, const std::string& value);
107 
108 
111  // Moves the iterator forward until no more whitespace is found
113  TGUI_API bool removeWhitespace(const std::string& line, std::string::const_iterator& c);
114 
115 
118  // Converts a string to lowercase.
120  TGUI_API std::string toLower(std::string str);
121 
122 
125  // Trims the whitespace from a string.
127  TGUI_API std::string trim(std::string str);
128 
129 
131 }
132 
134 
135 #endif // TGUI_GLOBAL_HPP
136 
Namespace that contains all TGUI functions and classes.
Definition: Animation.hpp:33
TGUI_API void enableTabKeyUsage()
While tab key usage is enabled (default), pressing tab will focus another widget. ...
TGUI_API void disableTabKeyUsage()
When disabling the tab key usage, pressing tab will no longer focus another widget.
TGUI_API const std::string & getResourcePath()
Returns the resource path.
TGUI_API void setResourcePath(const std::string &path)
Sets a new resource path.