Cleanup ACE_HAS_PTHREAD_SIGMASK_PROTOTYPE, all platforms support it so far as I can...
[ACE_TAO.git] / ACE / apps / JAWS2 / HTTPU / parse_url.h
blobf058441738956c0c45c1e011b49d549b67b81159
1 /* -*- c++ -*- */
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
9 // CAVEAT:
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.
17 public:
18 HTTP_Parse_URL (const char *url = 0);
19 ~HTTP_Parse_URL ();
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;
29 int port () 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_ ); }
36 int is_cgi () const;
38 private:
39 void parse_url ();
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 ();
47 private:
48 char *url_;
50 const char *scheme_;
51 const char *user_;
52 const char *passwd_;
53 const char *host_;
54 int port_;
55 const char *url_path_;
57 int error_;
58 int is_cgi_;
61 #endif /* !defined (HTTPU_HTTP_PARSE_H) */