tmxlite: D:/W/B/src/tmxlite-1.4.5/tmxlite/include/tmxlite/detail/Android.hpp Source File

tmxlite 1.0.0 lightweight parse for Tiled maps

Android.hpp
1/*********************************************************************
2Matt Marchant 2016
3http://trederia.blogspot.com
4
5tmxlite - Zlib license.
6
7This software is provided 'as-is', without any express or
8implied warranty. In no event will the authors be held
9liable for any damages arising from the use of this software.
10
11Permission is granted to anyone to use this software for any purpose,
12including commercial applications, and to alter it and redistribute
13it freely, subject to the following restrictions:
14
151. The origin of this software must not be misrepresented;
16you must not claim that you wrote the original software.
17If you use this software in a product, an acknowledgment
18in the product documentation would be appreciated but
19is not required.
20
212. Altered source versions must be plainly marked as such,
22and must not be misrepresented as being the original software.
23
243. This notice may not be removed or altered from any
25source distribution.
26*********************************************************************/
27
28#ifndef ANDROID_INC_HPP_
29#define ANDROID_INC_HPP_
30#ifdef __ANDROID__
31
32#include <string>
33#include <sstream>
34
35#include <cstdlib>
36
37namespace std
38{
39 template <typename T>
40 std::string to_string(T value)
41 {
42 std::ostringstream os;
43 os << value;
44 return os.str();
45 }
46}
47
48#define STOI(str) std::strtol(str.c_str(), 0, 10)
49#else
50#define STOI(str) std::stoi(str)
51
52#endif // __ANDROID__
53#endif // ANDROID_INC_HPP_