Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » UppHub » FTP class and reference example for U++
Re: FTP class and reference example for U++ [message #47876 is a reply to message #47869] Sat, 15 April 2017 19:23 Go to previous messageGo to previous message
Klugier is currently offline  Klugier
Messages: 1075
Registered: September 2012
Location: Poland, Kraków
Senior Contributor
Hello,

It is good to hear you introduced my proposals Smile

_________________________________________

I see one minor things to improvement - you could change the parameter name from whenwait to whenWait it will be more readable.

DirEntry&       User(const String& u)                           { vm(USER) = u; return *this; }

Should it be SetUser(const String& u)? Moreover the u parameter is misleading for the API consumer it should be explicitly called user.

_________________________________________

You should also consider moving your enums to c++ style:
 enum Style      { UNIX, DOS }; 

enum class Type { UNIX, DOS }; // You could consider chaining the name to Type

// The user can refere:
DirEntry::Type::UNIX

instead of:
DirEntry::UNIX

_________________________________________

Do we rely need this friendship declaration here?
        ValueMap        vm;
        Bits            owner, group, other;
        friend bool     ParseFtpDirEntry(const String& in, Vector<Ftp::DirEntry>& out);


Why not just create
const ValueMap& GetVm(); // Read only access - i believe ParseFtpDirEntry doesn't set anything?

IMO the variable name "vm" is also misleading. I would call it dirInfo or something more verbose. The same improvment can be used in Result class - just call it resultInfo.

_________________________________________

(Cosmetic - tiny) The class beginning has got problem with readability. It could be:
class Ftp : private NoCopy {
public: // Just remove extra empty line.
	class Request;
	class Result; // Do we need forward declarations in class? I believe when we remove friendship we will not ;)

        class DirEntry final : Moveable<Ftp::DirEntry> {



Sincerely,
Klugier


U++ - one framework to rule them all.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Am I doing something wrong, or is there a bug? FIREBIRD
Next Topic: OpenCV and openCV_Demo copiling error
Goto Forum:
  


Current Time: Fri Mar 29 12:24:51 CET 2024

Total time taken to generate the page: 0.01311 seconds