The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
sdl2.hpp
Go to the documentation of this file.
1 /*
2  Copyright (C) 2014 - 2016 by Mark de Wever <[email protected]>
3  Part of the Battle for Wesnoth Project http://www.wesnoth.org
4 
5  This program is free software; you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation; either version 2 of the License, or
8  (at your option) any later version.
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY.
11 
12  See the COPYING file for more details.
13 */
14 
15 #ifndef TOOLS_SDL2_SDL2_HPP_INCLUDED
16 #define TOOLS_SDL2_SDL2_HPP_INCLUDED
17 
18 #include <string>
19 #include <vector>
20 
21 namespace sdl
22 {
23 class twindow;
24 } // namespace sdl
25 
26 /**
27  * Contains the windows created by the user.
28  *
29  * @note The pointers are leaked when the program terminates, leaving it to the
30  * OS to do the cleanup.
31  */
32 extern std::vector<sdl::twindow*> windows;
33 
34 /**
35  * Gets a token from a string.
36  *
37  * Tokens are separated by a single @p separator character.
38  *
39  * @param string The string to search for tokens.
40  * @param[in,out] begin Input:
41  * - The beginning of the current token. The
42  * text until the next @p separator is matched.
43  * Output:
44  * - The position of the next token or the end
45  * of the @p string if the @p separator
46  * character was not found.
47  * @param separator The character marking the separation between
48  * tokens.
49  *
50  * @returns The matched string. The match is either until
51  * the @p separator character, or if the
52  * character is not found until the end of the
53  * @p string.
54  */
55 std::string get_token(const std::string& string,
56  std::string::const_iterator& begin,
57  const char separator);
58 
59 #endif
std::string get_token(const std::string &string, std::string::const_iterator &begin, const char separator)
Gets a token from a string.
Definition: sdl2.cpp:121
std::vector< sdl::twindow * > windows
Contains the windows created by the user.
Definition: sdl2.cpp:33
GLsizei const GLcharARB ** string
Definition: glew.h:4503