Skip to content
Browse files

Renamed Ftp::ListingDirectory::getFilenames() to getListing()

  • Loading branch information...
1 parent 49f37ee commit c02e375399b3006514d900dfee0d9a59a8f497b7 @LaurentGomila LaurentGomila committed
Showing with 9 additions and 9 deletions.
  1. +2 −2 examples/ftp/Ftp.cpp
  2. +4 −4 include/SFML/Network/Ftp.hpp
  3. +3 −3 src/SFML/Network/Ftp.cpp
View
4 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<std::string> filenames = response.getFilenames();
- for (std::vector<std::string>::const_iterator it = filenames.begin(); it != filenames.end(); ++it)
+ const std::vector<std::string>& names = response.getListing();
+ for (std::vector<std::string>::const_iterator it = names.begin(); it != names.end(); ++it)
std::cout << *it << std::endl;
break;
}
View
8 include/SFML/Network/Ftp.hpp
@@ -232,19 +232,19 @@ public :
ListingResponse(const Response& response, const std::vector<char>& 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<std::string>& getFilenames() const;
+ const std::vector<std::string>& getListing() const;
private :
////////////////////////////////////////////////////////////
// Member data
////////////////////////////////////////////////////////////
- std::vector<std::string> m_filenames; ///< Filenames extracted from the data
+ std::vector<std::string> m_listing; ///< Directory/file names extracted from the data
};
View
6 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<std::string>& Ftp::ListingResponse::getFilenames() const
+const std::vector<std::string>& Ftp::ListingResponse::getListing() const
{
- return m_filenames;
+ return m_listing;
}

0 comments on commit c02e375

Please sign in to comment.
Something went wrong with that request. Please try again.