2 #ifndef HTTPU_HTTP_PARSE_H
3 #define HTTPU_HTTP_PARSE_H
5 #include "HTTPU/http_export.h"
7 class HTTPU_Export HTTP_Parse_URL
11 // The user of the class is responsible for testing the difference
12 // between a missing username versus an empty one. Same goes for
13 // password The RFC (1738) makes the differentiation for username
14 // and password. If the hostname is missing (or empty), this class
15 // always returns a null value for the host.
18 HTTP_Parse_URL (const char *url
= 0);
21 void init (const char *url
);
23 enum URL_SCHEME
{ HTTP
, FTP
};
25 const char *scheme () const;
26 const char *user () const;
27 const char *passwd () const;
28 const char *host () const;
30 const char *url_path () const;
32 enum URL_ERROR
{ URL_ERROR_NONE
, URL_ERROR_STRDUP
, URL_ERROR_SCHEME
, URL_ERROR_SLASHSLASH
};
34 int error () const { return( error_
); }
40 void parse_scheme (char *&p
);
41 void parse_host (char *&p
);
42 void parse_url_path (char *&p
);
43 void is_cgi (const char *path
);
45 void set_port_from_scheme ();
55 const char *url_path_
;
61 #endif /* !defined (HTTPU_HTTP_PARSE_H) */