diff --git a/CMakeTests/FindSFML.cmake b/CMakeTests/FindSFML.cmake
index fd5f5fff48..b99e137881 100644
--- a/CMakeTests/FindSFML.cmake
+++ b/CMakeTests/FindSFML.cmake
@@ -1,20 +1,59 @@
-# Locate the SFML library
+# This script locates the SFML library
+# ------------------------------------
#
-# This module defines the following variables:
-# - For each module XXX (SYSTEM, WINDOW, GRAPHICS, NETWORK, AUDIO, MAIN):
-# - SFML_XXX_LIBRARY_DEBUG, the name of the debug library of the xxx module (set to SFML_XXX_LIBRARY_RELEASE is no debug version is found)
-# - SFML_XXX_LIBRARY_RELEASE, the name of the release library of the xxx module (set to SFML_XXX_LIBRARY_DEBUG is no release version is found)
-# - SFML_XXX_LIBRARY, the name of the library to link to for the xxx module (includes both debug and optimized names if necessary)
-# - SFML_XXX_FOUND, true if either the debug or release library of the xxx module is found
-# - SFML_LIBRARIES, the list of all libraries corresponding to the required modules
-# - SFML_FOUND, true if all the required modules are found
-# - SFML_INCLUDE_DIR, the path where SFML headers are located (the directory containing the SFML/Config.hpp file)
+# Usage
+# -----
+#
+# When you try to locate the SFML libraries, you must specify which modules you want to use (system, window, graphics, network, audio, main).
+# If none is given, the SFML_LIBRARIES variable will be empty and you'll end up linking to nothing.
+# example:
+# find_package(SFML COMPONENTS graphics window system) // find the graphics, window and system modules
+#
+# You can enforce a specific version, either MAJOR.MINOR or only MAJOR.
+# If nothing is specified, the version won't be checked (ie. any version will be accepted).
+# example:
+# find_package(SFML COMPONENTS ...) // no specific version required
+# find_package(SFML 2 COMPONENTS ...) // any 2.x version
+# find_package(SFML 2.4 COMPONENTS ...) // version 2.4 or greater
#
# By default, the dynamic libraries of SFML will be found. To find the static ones instead,
# you must set the SFML_STATIC_LIBRARIES variable to TRUE before calling find_package(SFML ...).
+# In case of static linking, the SFML_STATIC macro will also be defined by this script.
+# example:
+# set(SFML_STATIC_LIBRARIES TRUE)
+# find_package(SFML 2 COMPONENTS network system)
#
-# If SFML is not installed in a standard path, you can use the SFMLDIR CMake variable or environment variable
+# On Mac OS X if SFML_STATIC_LIBRARIES is not set to TRUE then by default CMake will search for frameworks unless
+# CMAKE_FIND_FRAMEWORK is set to "NEVER" for example. Please refer to CMake documentation for more details.
+# Moreover, keep in mind that SFML frameworks are only available as release libraries unlike dylibs which
+# are available for both release and debug modes.
+#
+# If SFML is not installed in a standard path, you can use the SFML_ROOT CMake (or environment) variable
# to tell CMake where SFML is.
+#
+# Output
+# ------
+#
+# This script defines the following variables:
+# - For each specified module XXX (system, window, graphics, network, audio, main):
+# - SFML_XXX_LIBRARY_DEBUG: the name of the debug library of the xxx module (set to SFML_XXX_LIBRARY_RELEASE is no debug version is found)
+# - SFML_XXX_LIBRARY_RELEASE: the name of the release library of the xxx module (set to SFML_XXX_LIBRARY_DEBUG is no release version is found)
+# - SFML_XXX_LIBRARY: the name of the library to link to for the xxx module (includes both debug and optimized names if necessary)
+# - SFML_XXX_FOUND: true if either the debug or release library of the xxx module is found
+# - SFML_LIBRARIES: the list of all libraries corresponding to the required modules
+# - SFML_FOUND: true if all the required modules are found
+# - SFML_INCLUDE_DIR: the path where SFML headers are located (the directory containing the SFML/Config.hpp file)
+#
+# example:
+# find_package(SFML 2 COMPONENTS system window graphics audio REQUIRED)
+# include_directories(${SFML_INCLUDE_DIR})
+# add_executable(myapp ...)
+# target_link_libraries(myapp ${SFML_LIBRARIES})
+
+# define the SFML_STATIC macro if static build was chosen
+if(SFML_STATIC_LIBRARIES)
+ add_definitions(-DSFML_STATIC)
+endif()
# deduce the libraries suffix from the options
set(FIND_SFML_LIB_SUFFIX "")
@@ -26,6 +65,8 @@ endif()
find_path(SFML_INCLUDE_DIR SFML/Config.hpp
PATH_SUFFIXES include
PATHS
+ ${SFML_ROOT}
+ $ENV{SFML_ROOT}
~/Library/Frameworks
/Library/Frameworks
/usr/local/
@@ -33,19 +74,19 @@ find_path(SFML_INCLUDE_DIR SFML/Config.hpp
/sw # Fink
/opt/local/ # DarwinPorts
/opt/csw/ # Blastwave
- /opt/
- ${SFMLDIR}
- $ENV{SFMLDIR})
-
-
-# will be set to false if one of the required modules is not found
-set(SFML_FOUND TRUE)
-set(SFML_VERSION_OK TRUE)
+ /opt/)
# check the version number
-if(SFML_FIND_VERSION AND SFML_INCLUDE_DIR AND NOT (SFML_INCLUDE_DIR STREQUAL "SFML_INCLUDE_DIR-NOTFOUND"))
+set(SFML_VERSION_OK TRUE)
+if(SFML_FIND_VERSION AND SFML_INCLUDE_DIR)
# extract the major and minor version numbers from SFML/Config.hpp
- FILE(READ "${SFML_INCLUDE_DIR}/SFML/Config.hpp" SFML_CONFIG_HPP_CONTENTS)
+ # we have to handle framework a little bit differently :
+ if("${SFML_INCLUDE_DIR}" MATCHES "SFML.framework")
+ set(SFML_CONFIG_HPP_INPUT "${SFML_INCLUDE_DIR}/Headers/Config.hpp")
+ else()
+ set(SFML_CONFIG_HPP_INPUT "${SFML_INCLUDE_DIR}/SFML/Config.hpp")
+ endif()
+ FILE(READ "${SFML_CONFIG_HPP_INPUT}" SFML_CONFIG_HPP_CONTENTS)
STRING(REGEX MATCH ".*#define SFML_VERSION_MAJOR ([0-9]+).*#define SFML_VERSION_MINOR ([0-9]+).*" SFML_CONFIG_HPP_CONTENTS "${SFML_CONFIG_HPP_CONTENTS}")
STRING(REGEX REPLACE ".*#define SFML_VERSION_MAJOR ([0-9]+).*" "\\1" SFML_VERSION_MAJOR "${SFML_CONFIG_HPP_CONTENTS}")
STRING(REGEX REPLACE ".*#define SFML_VERSION_MINOR ([0-9]+).*" "\\1" SFML_VERSION_MINOR "${SFML_CONFIG_HPP_CONTENTS}")
@@ -68,22 +109,21 @@ if(SFML_FIND_VERSION AND SFML_INCLUDE_DIR AND NOT (SFML_INCLUDE_DIR STREQUAL "SF
set(SFML_VERSION_MINOR x)
endif()
endif()
-elseif(SFML_INCLUDE_DIR STREQUAL "SFML_INCLUDE_DIR-NOTFOUND")
- set(SFML_FOUND FALSE)
- set(FIND_SFML_MISSING "${FIND_SFML_MISSING} SFML_INCLUDE_DIR")
endif()
# find the requested modules
-set(FIND_SFML_LIB_PATHS ~/Library/Frameworks
- /Library/Frameworks
- /usr/local
- /usr
- /sw
- /opt/local
- /opt/csw
- /opt
- ${SFMLDIR}
- $ENV{SFMLDIR})
+set(SFML_FOUND TRUE) # will be set to false if one of the required modules is not found
+set(FIND_SFML_LIB_PATHS
+ ${SFML_ROOT}
+ $ENV{SFML_ROOT}
+ ~/Library/Frameworks
+ /Library/Frameworks
+ /usr/local
+ /usr
+ /sw
+ /opt/local
+ /opt/csw
+ /opt)
foreach(FIND_SFML_COMPONENT ${SFML_FIND_COMPONENTS})
string(TOLOWER ${FIND_SFML_COMPONENT} FIND_SFML_COMPONENT_LOWER)
string(TOUPPER ${FIND_SFML_COMPONENT} FIND_SFML_COMPONENT_UPPER)
@@ -109,7 +149,7 @@ foreach(FIND_SFML_COMPONENT ${SFML_FIND_COMPONENTS})
if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG OR SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE)
# library found
set(SFML_${FIND_SFML_COMPONENT_UPPER}_FOUND TRUE)
-
+
# if both are found, set SFML_XXX_LIBRARY to contain both
if (SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG AND SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_RELEASE)
set(SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY debug ${SFML_${FIND_SFML_COMPONENT_UPPER}_LIBRARY_DEBUG}
@@ -165,5 +205,5 @@ endif()
# handle success
if(SFML_FOUND)
- message("Found SFML: ${SFML_INCLUDE_DIR}")
+ message(STATUS "Found SFML ${SFML_VERSION_MAJOR}.${SFML_VERSION_MINOR} in ${SFML_INCLUDE_DIR}")
endif()
diff --git a/Externals/SFML/CMakeLists.txt b/Externals/SFML/CMakeLists.txt
index b03bd713c0..e2127502a6 100644
--- a/Externals/SFML/CMakeLists.txt
+++ b/Externals/SFML/CMakeLists.txt
@@ -1,17 +1,28 @@
-include_directories(BEFORE include)
+include_directories(BEFORE include src)
-set(SRCS src/SFML/Network/Ftp.cpp
- src/SFML/Network/Http.cpp
- src/SFML/Network/IPAddress.cpp
- src/SFML/Network/Packet.cpp
- src/SFML/Network/SelectorBase.cpp
- src/SFML/Network/SocketTCP.cpp
- src/SFML/Network/SocketUDP.cpp)
+set(SRC_NETWORK
+ src/SFML/Network/Http.cpp
+ src/SFML/Network/IPAddress.cpp
+ src/SFML/Network/Packet.cpp
+ src/SFML/Network/Socket.cpp
+ src/SFML/Network/SocketSelector.cpp
+ src/SFML/Network/TcpListener.cpp
+ src/SFML/Network/TcpSocket.cpp
+ src/SFML/Network/UdpSocket.cpp
+)
-if(UNIX)
- set(SRCS ${SRCS} src/SFML/Network/Unix/SocketHelper.cpp)
-elseif(WIN32)
- set(SRCS ${SRCS} src/SFML/Network/Win32/SocketHelper.cpp)
+if(WIN32)
+ list(APPEND SRC_NETWORK src/SFML/Network/Win32/SocketImpl.cpp)
+else()
+ list(APPEND SRC_NETWORK src/SFML/Network/Unix/SocketImpl.cpp)
endif()
-add_library(sfml-network ${SRCS})
+set(SRC_SYSTEM
+ src/SFML/System/Err.cpp
+ src/SFML/System/String.cpp
+ src/SFML/System/Time.cpp
+)
+
+add_definitions(-DSFML_STATIC)
+add_library(sfml-network ${SRC_NETWORK})
+add_library(sfml-system ${SRC_SYSTEM})
diff --git a/Externals/SFML/build/vc2010/SFML_Network.vcxproj b/Externals/SFML/build/vc2010/SFML_Network.vcxproj
index 78620e6564..18a955cc3f 100644
--- a/Externals/SFML/build/vc2010/SFML_Network.vcxproj
+++ b/Externals/SFML/build/vc2010/SFML_Network.vcxproj
@@ -42,33 +42,50 @@
+
+
+ ..\..\src;%(AdditionalIncludeDirectories)
+
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
-
+
+
+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
\ No newline at end of file
+
diff --git a/Externals/SFML/build/vc2010/SFML_Network.vcxproj.filters b/Externals/SFML/build/vc2010/SFML_Network.vcxproj.filters
index 56ab9101fb..c80b82db38 100644
--- a/Externals/SFML/build/vc2010/SFML_Network.vcxproj.filters
+++ b/Externals/SFML/build/vc2010/SFML_Network.vcxproj.filters
@@ -1,38 +1,50 @@
-
-
-
-
-
+
+
+
+
+
+
Win32
+
+
+
-
+
+
+
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Win32
-
-
-
{8280ecca-24fc-48a2-b7f5-6aca41826b66}
-
\ No newline at end of file
+
diff --git a/Externals/SFML/include/SFML/Config.hpp b/Externals/SFML/include/SFML/Config.hpp
index 2a8cf123b3..d825a5af85 100644
--- a/Externals/SFML/include/SFML/Config.hpp
+++ b/Externals/SFML/include/SFML/Config.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -25,6 +25,14 @@
#ifndef SFML_CONFIG_HPP
#define SFML_CONFIG_HPP
+
+////////////////////////////////////////////////////////////
+// Define the SFML version
+////////////////////////////////////////////////////////////
+#define SFML_VERSION_MAJOR 2
+#define SFML_VERSION_MINOR 1
+
+
////////////////////////////////////////////////////////////
// Identify the operating system
////////////////////////////////////////////////////////////
@@ -32,9 +40,6 @@
// Windows
#define SFML_SYSTEM_WINDOWS
- #ifndef WIN32_LEAN_AND_MEAN
- #define WIN32_LEAN_AND_MEAN
- #endif
#ifndef NOMINMAX
#define NOMINMAX
#endif
@@ -49,8 +54,7 @@
// MacOS
#define SFML_SYSTEM_MACOS
-#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || \
- defined(__NetBSD__) || defined(__OpenBSD__)
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
// FreeBSD
#define SFML_SYSTEM_FREEBSD
@@ -74,45 +78,47 @@
////////////////////////////////////////////////////////////
-// Define portable import / export macros
+// Define helpers to create portable import / export macros for each module
////////////////////////////////////////////////////////////
-#if defined(SFML_SYSTEM_WINDOWS)
+#if !defined(SFML_STATIC)
- #ifdef SFML_DYNAMIC
+ #if defined(SFML_SYSTEM_WINDOWS)
- // Windows platforms
- #ifdef SFML_EXPORTS
+ // Windows compilers need specific (and different) keywords for export and import
+ #define SFML_API_EXPORT __declspec(dllexport)
+ #define SFML_API_IMPORT __declspec(dllimport)
- // From DLL side, we must export
- #define SFML_API __declspec(dllexport)
-
- #else
-
- // From client application side, we must import
- #define SFML_API __declspec(dllimport)
-
- #endif
-
- // For Visual C++ compilers, we also need to turn off this annoying C4251 warning.
- // You can read lots ot different things about it, but the point is the code will
- // just work fine, and so the simplest way to get rid of this warning is to disable it
+ // For Visual C++ compilers, we also need to turn off this annoying C4251 warning
#ifdef _MSC_VER
#pragma warning(disable : 4251)
#endif
- #else
+ #else // Linux, FreeBSD, Mac OS X
- // No specific directive needed for static build
- #define SFML_API
+ #if __GNUC__ >= 4
+
+ // GCC 4 has special keywords for showing/hidding symbols,
+ // the same keyword is used for both importing and exporting
+ #define SFML_API_EXPORT __attribute__ ((__visibility__ ("default")))
+ #define SFML_API_IMPORT __attribute__ ((__visibility__ ("default")))
+
+ #else
+
+ // GCC < 4 has no mechanism to explicitely hide symbols, everything's exported
+ #define SFML_API_EXPORT
+ #define SFML_API_IMPORT
+
+ #endif
#endif
#else
- // Other platforms don't need to define anything
- #define SFML_API
+ // Static build doesn't need import/export macros
+ #define SFML_API_EXPORT
+ #define SFML_API_IMPORT
#endif
@@ -120,44 +126,31 @@
////////////////////////////////////////////////////////////
// Define portable fixed-size types
////////////////////////////////////////////////////////////
-#include
-
namespace sf
{
+ // All "common" platforms use the same size for char, short and int
+ // (basically there are 3 types for 3 sizes, so no other match is possible),
+ // we can use them without doing any kind of check
+
// 8 bits integer types
- #if UCHAR_MAX == 0xFF
- typedef signed char Int8;
- typedef unsigned char Uint8;
- #else
- #error No 8 bits integer type for this platform
- #endif
+ typedef signed char Int8;
+ typedef unsigned char Uint8;
// 16 bits integer types
- #if USHRT_MAX == 0xFFFF
- typedef signed short Int16;
- typedef unsigned short Uint16;
- #elif UINT_MAX == 0xFFFF
- typedef signed int Int16;
- typedef unsigned int Uint16;
- #elif ULONG_MAX == 0xFFFF
- typedef signed long Int16;
- typedef unsigned long Uint16;
- #else
- #error No 16 bits integer type for this platform
- #endif
+ typedef signed short Int16;
+ typedef unsigned short Uint16;
// 32 bits integer types
- #if USHRT_MAX == 0xFFFFFFFF
- typedef signed short Int32;
- typedef unsigned short Uint32;
- #elif UINT_MAX == 0xFFFFFFFF
- typedef signed int Int32;
- typedef unsigned int Uint32;
- #elif ULONG_MAX == 0xFFFFFFFF
- typedef signed long Int32;
- typedef unsigned long Uint32;
+ typedef signed int Int32;
+ typedef unsigned int Uint32;
+
+ // 64 bits integer types
+ #if defined(_MSC_VER)
+ typedef signed __int64 Int64;
+ typedef unsigned __int64 Uint64;
#else
- #error No 32 bits integer type for this platform
+ typedef signed long long Int64;
+ typedef unsigned long long Uint64;
#endif
} // namespace sf
diff --git a/Externals/SFML/include/SFML/Network.hpp b/Externals/SFML/include/SFML/Network.hpp
index b0ca47d2b1..62f1286e0e 100644
--- a/Externals/SFML/include/SFML/Network.hpp
+++ b/Externals/SFML/include/SFML/Network.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -30,13 +30,24 @@
////////////////////////////////////////////////////////////
#include
-#include
+//#include
#include
+
+// This file is "IpAddress.hpp" upstream
#include
#include
-#include
-#include
-#include
+#include
+#include
+#include
+#include
#endif // SFML_NETWORK_HPP
+
+////////////////////////////////////////////////////////////
+/// \defgroup network Network module
+///
+/// Socket-based communication, utilities and higher-level
+/// network protocols (HTTP, FTP).
+///
+////////////////////////////////////////////////////////////
diff --git a/Externals/SFML/include/SFML/Network/Export.hpp b/Externals/SFML/include/SFML/Network/Export.hpp
new file mode 100644
index 0000000000..7dcd1d074f
--- /dev/null
+++ b/Externals/SFML/include/SFML/Network/Export.hpp
@@ -0,0 +1,48 @@
+////////////////////////////////////////////////////////////
+//
+// SFML - Simple and Fast Multimedia Library
+// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
+//
+// This software is provided 'as-is', without any express or implied warranty.
+// In no event will the authors be held liable for any damages arising from the use of this software.
+//
+// Permission is granted to anyone to use this software for any purpose,
+// including commercial applications, and to alter it and redistribute it freely,
+// subject to the following restrictions:
+//
+// 1. The origin of this software must not be misrepresented;
+// you must not claim that you wrote the original software.
+// If you use this software in a product, an acknowledgment
+// in the product documentation would be appreciated but is not required.
+//
+// 2. Altered source versions must be plainly marked as such,
+// and must not be misrepresented as being the original software.
+//
+// 3. This notice may not be removed or altered from any source distribution.
+//
+////////////////////////////////////////////////////////////
+
+#ifndef SFML_NETWORK_EXPORT_HPP
+#define SFML_NETWORK_EXPORT_HPP
+
+////////////////////////////////////////////////////////////
+// Headers
+////////////////////////////////////////////////////////////
+#include
+
+
+////////////////////////////////////////////////////////////
+// Define portable import / export macros
+////////////////////////////////////////////////////////////
+#if defined(SFML_NETWORK_EXPORTS)
+
+ #define SFML_NETWORK_API SFML_API_EXPORT
+
+#else
+
+ #define SFML_NETWORK_API SFML_API_IMPORT
+
+#endif
+
+
+#endif // SFML_NETWORK_EXPORT_HPP
diff --git a/Externals/SFML/include/SFML/Network/Ftp.hpp b/Externals/SFML/include/SFML/Network/Ftp.hpp
deleted file mode 100644
index efc3a819b7..0000000000
--- a/Externals/SFML/include/SFML/Network/Ftp.hpp
+++ /dev/null
@@ -1,448 +0,0 @@
-////////////////////////////////////////////////////////////
-//
-// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com)
-//
-// This software is provided 'as-is', without any express or implied warranty.
-// In no event will the authors be held liable for any damages arising from the use of this software.
-//
-// Permission is granted to anyone to use this software for any purpose,
-// including commercial applications, and to alter it and redistribute it freely,
-// subject to the following restrictions:
-//
-// 1. The origin of this software must not be misrepresented;
-// you must not claim that you wrote the original software.
-// If you use this software in a product, an acknowledgment
-// in the product documentation would be appreciated but is not required.
-//
-// 2. Altered source versions must be plainly marked as such,
-// and must not be misrepresented as being the original software.
-//
-// 3. This notice may not be removed or altered from any source distribution.
-//
-////////////////////////////////////////////////////////////
-
-#ifndef SFML_FTP_HPP
-#define SFML_FTP_HPP
-
-////////////////////////////////////////////////////////////
-// Headers
-////////////////////////////////////////////////////////////
-#include
-#include
-#include
-#include
-
-
-namespace sf
-{
-class IPAddress;
-
-////////////////////////////////////////////////////////////
-/// This class provides methods for manipulating the FTP
-/// protocol (described in RFC 959).
-/// It provides easy access and transfers to remote
-/// directories and files on a FTP server
-////////////////////////////////////////////////////////////
-class SFML_API Ftp : NonCopyable
-{
-public :
-
- ////////////////////////////////////////////////////////////
- /// Enumeration of transfer modes
- ////////////////////////////////////////////////////////////
- enum TransferMode
- {
- Binary, ///< Binary mode (file is transfered as a sequence of bytes)
- Ascii, ///< Text mode using ASCII encoding
- Ebcdic ///< Text mode using EBCDIC encoding
- };
-
- ////////////////////////////////////////////////////////////
- /// This class wraps a FTP response, which is basically :
- /// - a status code
- /// - a message
- ////////////////////////////////////////////////////////////
- class SFML_API Response
- {
- public :
-
- ////////////////////////////////////////////////////////////
- /// Enumerate all the valid status codes returned in
- /// a FTP response
- ////////////////////////////////////////////////////////////
- enum Status
- {
- // 1xx: the requested action is being initiated,
- // expect another reply before proceeding with a new command
- RestartMarkerReply = 110, ///< Restart marker reply
- ServiceReadySoon = 120, ///< Service ready in N minutes
- DataConnectionAlreadyOpened = 125, ///< Data connection already opened, transfer starting
- OpeningDataConnection = 150, ///< File status ok, about to open data connection
-
- // 2xx: the requested action has been successfully completed
- Ok = 200, ///< Command ok
- PointlessCommand = 202, ///< Command not implemented
- SystemStatus = 211, ///< System status, or system help reply
- DirectoryStatus = 212, ///< Directory status
- FileStatus = 213, ///< File status
- HelpMessage = 214, ///< Help message
- SystemType = 215, ///< NAME system type, where NAME is an official system name from the list in the Assigned Numbers document
- ServiceReady = 220, ///< Service ready for new user
- ClosingConnection = 221, ///< Service closing control connection
- DataConnectionOpened = 225, ///< Data connection open, no transfer in progress
- ClosingDataConnection = 226, ///< Closing data connection, requested file action successful
- EnteringPassiveMode = 227, ///< Entering passive mode
- LoggedIn = 230, ///< User logged in, proceed. Logged out if appropriate
- FileActionOk = 250, ///< Requested file action ok
- DirectoryOk = 257, ///< PATHNAME created
-
- // 3xx: the command has been accepted, but the requested action
- // is dormant, pending receipt of further information
- NeedPassword = 331, ///< User name ok, need password
- NeedAccountToLogIn = 332, ///< Need account for login
- NeedInformation = 350, ///< Requested file action pending further information
-
- // 4xx: the command was not accepted and the requested action did not take place,
- // but the error condition is temporary and the action may be requested again
- ServiceUnavailable = 421, ///< Service not available, closing control connection
- DataConnectionUnavailable = 425, ///< Can't open data connection
- TransferAborted = 426, ///< Connection closed, transfer aborted
- FileActionAborted = 450, ///< Requested file action not taken
- LocalError = 451, ///< Requested action aborted, local error in processing
- InsufficientStorageSpace = 452, ///< Requested action not taken; insufficient storage space in system, file unavailable
-
- // 5xx: the command was not accepted and
- // the requested action did not take place
- CommandUnknown = 500, ///< Syntax error, command unrecognized
- ParametersUnknown = 501, ///< Syntax error in parameters or arguments
- CommandNotImplemented = 502, ///< Command not implemented
- BadCommandSequence = 503, ///< Bad sequence of commands
- ParameterNotImplemented = 504, ///< Command not implemented for that parameter
- NotLoggedIn = 530, ///< Not logged in
- NeedAccountToStore = 532, ///< Need account for storing files
- FileUnavailable = 550, ///< Requested action not taken, file unavailable
- PageTypeUnknown = 551, ///< Requested action aborted, page type unknown
- NotEnoughMemory = 552, ///< Requested file action aborted, exceeded storage allocation
- FilenameNotAllowed = 553, ///< Requested action not taken, file name not allowed
-
- // 10xx: SFML custom codes
- InvalidResponse = 1000, ///< Response is not a valid FTP one
- ConnectionFailed = 1001, ///< Connection with server failed
- ConnectionClosed = 1002, ///< Connection with server closed
- InvalidFile = 1003 ///< Invalid file to upload / download
- };
-
- ////////////////////////////////////////////////////////////
- /// Default constructor
- ///
- /// \param Code : Response status code (InvalidResponse by default)
- /// \param Message : Response message (empty by default)
- ///
- ////////////////////////////////////////////////////////////
- Response(Status Code = InvalidResponse, const std::string& Message = "");
-
- ////////////////////////////////////////////////////////////
- /// Convenience function to check if the response status code
- /// means a success
- ///
- /// \return True if status is success (code < 400)
- ///
- ////////////////////////////////////////////////////////////
- bool IsOk() const;
-
- ////////////////////////////////////////////////////////////
- /// Get the response status code
- ///
- /// \return Status code
- ///
- ////////////////////////////////////////////////////////////
- Status GetStatus() const;
-
- ////////////////////////////////////////////////////////////
- /// Get the full message contained in the response
- ///
- /// \return The response message
- ///
- ////////////////////////////////////////////////////////////
- const std::string& GetMessage() const;
-
- private :
-
- ////////////////////////////////////////////////////////////
- // Member data
- ////////////////////////////////////////////////////////////
- Status myStatus; ///< Status code returned from the server
- std::string myMessage; ///< Last message received from the server
- };
-
- ////////////////////////////////////////////////////////////
- /// Specialization of FTP response returning a directory
- ////////////////////////////////////////////////////////////
- class SFML_API DirectoryResponse : public Response
- {
- public :
-
- ////////////////////////////////////////////////////////////
- /// Default constructor
- ///
- /// \param Resp : Source response
- ///
- ////////////////////////////////////////////////////////////
- DirectoryResponse(Response Resp);
-
- ////////////////////////////////////////////////////////////
- /// Get the directory returned in the response
- ///
- /// \return Directory name
- ///
- ////////////////////////////////////////////////////////////
- const std::string& GetDirectory() const;
-
- private :
-
- ////////////////////////////////////////////////////////////
- // Member data
- ////////////////////////////////////////////////////////////
- std::string myDirectory; ///< Directory extracted from the response message
- };
-
-
- ////////////////////////////////////////////////////////////
- /// Specialization of FTP response returning a filename lisiting
- ////////////////////////////////////////////////////////////
- class SFML_API ListingResponse : public Response
- {
- public :
-
- ////////////////////////////////////////////////////////////
- /// Default constructor
- ///
- /// \param Resp : Source response
- /// \param Data : Data containing the raw listing
- ///
- ////////////////////////////////////////////////////////////
- ListingResponse(Response Resp, const std::vector& Data);
-
- ////////////////////////////////////////////////////////////
- /// Get the number of filenames in the listing
- ///
- /// \return Total number of filenames
- ///
- ////////////////////////////////////////////////////////////
- std::size_t GetCount() const;
-
- ////////////////////////////////////////////////////////////
- /// Get the Index-th filename in the directory
- ///
- /// \param Index : Index of the filename to get
- ///
- /// \return Index-th filename
- ///
- ////////////////////////////////////////////////////////////
- const std::string& GetFilename(std::size_t Index) const;
-
- private :
-
- ////////////////////////////////////////////////////////////
- // Member data
- ////////////////////////////////////////////////////////////
- std::vector myFilenames; ///< Filenames extracted from the data
- };
-
-
- ////////////////////////////////////////////////////////////
- /// Destructor -- close the connection with the server
- ///
- ////////////////////////////////////////////////////////////
- ~Ftp();
-
- ////////////////////////////////////////////////////////////
- /// Connect to the specified FTP server
- ///
- /// \param Server : FTP server to connect to
- /// \param Port : Port used for connection (21 by default, standard FTP port)
- /// \param Timeout : Maximum time to wait, in seconds (0 by default, means no timeout)
- ///
- /// \return Server response to the request
- ///
- ////////////////////////////////////////////////////////////
- Response Connect(const IPAddress& Server, unsigned short Port = 21, float Timeout = 0.f);
-
- ////////////////////////////////////////////////////////////
- /// Log in using anonymous account
- ///
- /// \return Server response to the request
- ///
- ////////////////////////////////////////////////////////////
- Response Login();
-
- ////////////////////////////////////////////////////////////
- /// Log in using a username and a password
- ///
- /// \param UserName : User name
- /// \param Password : Password
- ///
- /// \return Server response to the request
- ///
- ////////////////////////////////////////////////////////////
- Response Login(const std::string& UserName, const std::string& Password);
-
- ////////////////////////////////////////////////////////////
- /// Close the connection with FTP server
- ///
- /// \return Server response to the request
- ///
- ////////////////////////////////////////////////////////////
- Response Disconnect();
-
- ////////////////////////////////////////////////////////////
- /// Send a null command just to prevent from being disconnected
- ///
- /// \return Server response to the request
- ///
- ////////////////////////////////////////////////////////////
- Response KeepAlive();
-
- ////////////////////////////////////////////////////////////
- /// Get the current working directory
- ///
- /// \return Server response to the request
- ///
- ////////////////////////////////////////////////////////////
- DirectoryResponse GetWorkingDirectory();
-
- ////////////////////////////////////////////////////////////
- /// Get the contents of the given directory
- /// (subdirectories and files)
- ///
- /// \param Directory : Directory to list ("" by default, the current one)
- ///
- /// \return Server response to the request
- ///
- ////////////////////////////////////////////////////////////
- ListingResponse GetDirectoryListing(const std::string& Directory = "");
-
- ////////////////////////////////////////////////////////////
- /// Change the current working directory
- ///
- /// \param Directory : New directory, relative to the current one
- ///
- /// \return Server response to the request
- ///
- ////////////////////////////////////////////////////////////
- Response ChangeDirectory(const std::string& Directory);
-
- ////////////////////////////////////////////////////////////
- /// Go to the parent directory of the current one
- ///
- /// \return Server response to the request
- ///
- ////////////////////////////////////////////////////////////
- Response ParentDirectory();
-
- ////////////////////////////////////////////////////////////
- /// Create a new directory
- ///
- /// \param Name : Name of the directory to create
- ///
- /// \return Server response to the request
- ///
- ////////////////////////////////////////////////////////////
- Response MakeDirectory(const std::string& Name);
-
- ////////////////////////////////////////////////////////////
- /// Remove an existing directory
- ///
- /// \param Name : Name of the directory to remove
- ///
- /// \return Server response to the request
- ///
- ////////////////////////////////////////////////////////////
- Response DeleteDirectory(const std::string& Name);
-
- ////////////////////////////////////////////////////////////
- /// Rename a file
- ///
- /// \param File : File to rename
- /// \param NewName : New name
- ///
- /// \return Server response to the request
- ///
- ////////////////////////////////////////////////////////////
- Response RenameFile(const std::string& File, const std::string& NewName);
-
- ////////////////////////////////////////////////////////////
- /// Remove an existing file
- ///
- /// \param Name : File to remove
- ///
- /// \return Server response to the request
- ///
- ////////////////////////////////////////////////////////////
- Response DeleteFile(const std::string& Name);
-
- ////////////////////////////////////////////////////////////
- /// Download a file from the server
- ///
- /// \param DistantFile : Path of the distant file to download
- /// \param DestPath : Where to put to file on the local computer
- /// \param Mode : Transfer mode (binary by default)
- ///
- /// \return Server response to the request
- ///
- ////////////////////////////////////////////////////////////
- Response Download(const std::string& DistantFile, const std::string& DestPath, TransferMode Mode = Binary);
-
- ////////////////////////////////////////////////////////////
- /// Upload a file to the server
- ///
- /// \param LocalFile : Path of the local file to upload
- /// \param DestPath : Where to put to file on the server
- /// \param Mode : Transfer mode (binary by default)
- ///
- /// \return Server response to the request
- ///
- ////////////////////////////////////////////////////////////
- Response Upload(const std::string& LocalFile, const std::string& DestPath, TransferMode Mode = Binary);
-
-private :
-
- ////////////////////////////////////////////////////////////
- /// Send a command to the FTP server
- ///
- /// \param Command : Command to send
- /// \param Parameter : Command parameter ("" by default)
- ///
- /// \return Server response to the request
- ///
- ////////////////////////////////////////////////////////////
- Response SendCommand(const std::string& Command, const std::string& Parameter = "");
-
- ////////////////////////////////////////////////////////////
- /// Receive a response from the server
- /// (usually after a command has been sent)
- ///
- /// \return Server response to the request
- ///
- ////////////////////////////////////////////////////////////
- Response GetResponse();
-
- ////////////////////////////////////////////////////////////
- /// Utility class for exchanging datas with the server
- /// on the data channel
- ////////////////////////////////////////////////////////////
- class DataChannel;
-
- friend class DataChannel;
-
- ////////////////////////////////////////////////////////////
- // Member data
- ////////////////////////////////////////////////////////////
- SocketTCP myCommandSocket; ///< Socket holding the control connection with the server
-};
-
-} // namespace sf
-
-
-#endif // SFML_FTP_HPP
diff --git a/Externals/SFML/include/SFML/Network/Http.hpp b/Externals/SFML/include/SFML/Network/Http.hpp
index 137bf97130..58299051b8 100644
--- a/Externals/SFML/include/SFML/Network/Http.hpp
+++ b/Externals/SFML/include/SFML/Network/Http.hpp
@@ -1,7 +1,7 @@
////////////////////////////////////////////////////////////
//
// SFML - Simple and Fast Multimedia Library
-// Copyright (C) 2007-2009 Laurent Gomila (laurent.gom@gmail.com)
+// Copyright (C) 2007-2013 Laurent Gomila (laurent.gom@gmail.com)
//
// This software is provided 'as-is', without any express or implied warranty.
// In no event will the authors be held liable for any damages arising from the use of this software.
@@ -28,9 +28,11 @@
////////////////////////////////////////////////////////////
// Headers
////////////////////////////////////////////////////////////
-#include
+#include
#include
-#include
+#include
+#include
+#include
#include