From c02e375399b3006514d900dfee0d9a59a8f497b7 Mon Sep 17 00:00:00 2001 From: Laurent Gomila Date: Fri, 26 Oct 2012 17:09:43 +0200 Subject: [PATCH] Renamed Ftp::ListingDirectory::getFilenames() to getListing() --- examples/ftp/Ftp.cpp | 4 ++-- include/SFML/Network/Ftp.hpp | 8 ++++---- src/SFML/Network/Ftp.cpp | 6 +++--- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/examples/ftp/Ftp.cpp b/examples/ftp/Ftp.cpp index 9ea6118da..7b978609b 100644 --- a/examples/ftp/Ftp.cpp +++ b/examples/ftp/Ftp.cpp @@ -102,8 +102,8 @@ int main() // Print the contents of the current server directory sf::Ftp::ListingResponse response = server.getDirectoryListing(); std::cout << response << std::endl; - std::vector filenames = response.getFilenames(); - for (std::vector::const_iterator it = filenames.begin(); it != filenames.end(); ++it) + const std::vector& names = response.getListing(); + for (std::vector::const_iterator it = names.begin(); it != names.end(); ++it) std::cout << *it << std::endl; break; } diff --git a/include/SFML/Network/Ftp.hpp b/include/SFML/Network/Ftp.hpp index 55d09599d..965d233a4 100644 --- a/include/SFML/Network/Ftp.hpp +++ b/include/SFML/Network/Ftp.hpp @@ -232,19 +232,19 @@ public : ListingResponse(const Response& response, const std::vector& data); //////////////////////////////////////////////////////////// - /// \brief Return the array of filenames + /// \brief Return the array of directory/file names /// - /// \return Array containing the requested filenames + /// \return Array containing the requested listing /// //////////////////////////////////////////////////////////// - const std::vector& getFilenames() const; + const std::vector& getListing() const; private : //////////////////////////////////////////////////////////// // Member data //////////////////////////////////////////////////////////// - std::vector m_filenames; ///< Filenames extracted from the data + std::vector m_listing; ///< Directory/file names extracted from the data }; diff --git a/src/SFML/Network/Ftp.cpp b/src/SFML/Network/Ftp.cpp index 85b526e28..2ccd8d82f 100644 --- a/src/SFML/Network/Ftp.cpp +++ b/src/SFML/Network/Ftp.cpp @@ -124,7 +124,7 @@ Ftp::Response(response) std::string::size_type lastPos = 0; for (std::string::size_type pos = paths.find("\r\n"); pos != std::string::npos; pos = paths.find("\r\n", lastPos)) { - m_filenames.push_back(paths.substr(lastPos, pos - lastPos)); + m_listing.push_back(paths.substr(lastPos, pos - lastPos)); lastPos = pos + 2; } } @@ -132,9 +132,9 @@ Ftp::Response(response) //////////////////////////////////////////////////////////// -const std::vector& Ftp::ListingResponse::getFilenames() const +const std::vector& Ftp::ListingResponse::getListing() const { - return m_filenames; + return m_listing; }