Graphics/ToString.hpp
Go to the documentation of this file.
00001 
00002 //
00003 // Thor C++ Library
00004 // Copyright (c) 2011-2015 Jan Haller
00005 // 
00006 // This software is provided 'as-is', without any express or implied
00007 // warranty. In no event will the authors be held liable for any damages
00008 // arising from the use of this software.
00009 // 
00010 // Permission is granted to anyone to use this software for any purpose,
00011 // including commercial applications, and to alter it and redistribute it
00012 // freely, subject to the following restrictions:
00013 // 
00014 // 1. The origin of this software must not be misrepresented; you must not
00015 //    claim that you wrote the original software. If you use this software
00016 //    in a product, an acknowledgment in the product documentation would be
00017 //    appreciated but is not required.
00018 // 
00019 // 2. Altered source versions must be plainly marked as such, and must not be
00020 //    misrepresented as being the original software.
00021 // 
00022 // 3. This notice may not be removed or altered from any source distribution.
00023 //
00025 
00028 
00029 #ifndef THOR_TOSTRING_HPP
00030 #define THOR_TOSTRING_HPP
00031 
00032 // Note: Don't include specific headers to avoid unneeded dependencies. If one wants to
00033 // output a certain object, he/she has already included the corresponding header anyway.
00034 
00035 #include <Thor/Config.hpp>
00036 
00037 #include <Aurora/Tools/Exceptions.hpp>
00038 
00039 #include <sstream>
00040 
00041 
00042 namespace sf
00043 {
00044 
00045     class Color;
00046 
00047     template <typename T>
00048     class Vector2;
00049 
00050     template <typename T>
00051     class Vector3;
00052 
00053     template <typename T>
00054     class Rect;
00055 
00056 } // namespace sf
00057 
00058 
00059 namespace thor
00060 {
00061 
00062 template <typename T>
00063 struct PolarVector2;
00064 
00067 
00070 std::string THOR_API        toString(const sf::Color& color);
00071 
00074 template <typename T>
00075 std::string                 toString(const sf::Vector2<T>& vector);
00076 
00079 template <typename T>
00080 std::string                 toString(const sf::Vector3<T>& vector);
00081 
00084 template <typename T>
00085 std::string                 toString(const sf::Rect<T>& rect);
00086 
00089 template <typename T>
00090 std::string                 toString(const PolarVector2<T>& vector);
00091 
00092 
00095 class StringConversionException : public aurora::Exception
00096 {
00097     // ---------------------------------------------------------------------------------------------------------------------------
00098     // Public member functions
00099     public:
00102         explicit StringConversionException(const std::string& message)
00103         : aurora::Exception(message)
00104         {
00105         }
00106 };
00107 
00109 
00110 } // namespace thor
00111 
00112 #include <Thor/Graphics/Detail/ToString.inl>
00113 #endif // THOR_TOSTRING_HPP