18 #include "pandabase.h" 32 INLINE
URLSpec(
const string &url,
bool server_name_expected =
false);
33 INLINE URLSpec(
const URLSpec ©);
34 INLINE
void operator = (
const string &url);
35 void operator = (
const URLSpec ©);
37 INLINE
bool operator == (
const URLSpec &other)
const;
38 INLINE
bool operator != (
const URLSpec &other)
const;
39 INLINE
bool operator < (
const URLSpec &other)
const;
40 INLINE
int compare_to(
const URLSpec &other)
const;
42 INLINE
bool has_scheme()
const;
43 INLINE
bool has_authority()
const;
44 INLINE
bool has_username()
const;
45 INLINE
bool has_server()
const;
46 INLINE
bool has_port()
const;
47 INLINE
bool has_path()
const;
48 INLINE
bool has_query()
const;
50 string get_scheme()
const;
51 INLINE
string get_authority()
const;
52 INLINE
string get_username()
const;
53 INLINE
string get_server()
const;
54 INLINE
string get_port_str()
const;
56 string get_server_and_port()
const;
57 bool is_default_port()
const;
58 static int get_default_port_for_scheme(
const string &scheme);
59 string get_path()
const;
60 INLINE
string get_query()
const;
61 string get_path_and_query()
const;
62 INLINE
bool is_ssl()
const;
64 INLINE
const string &get_url()
const;
66 void set_scheme(
const string &scheme);
67 void set_authority(
const string &authority);
68 void set_username(
const string &username);
69 void set_server(
const string &server);
70 void set_port(
const string &port);
71 void set_port(
int port);
72 void set_server_and_port(
const string &server_and_port);
73 void set_path(
const string &path);
74 void set_query(
const string &query);
76 void set_url(
const string &url,
bool server_name_expected =
false);
78 INLINE
operator const string & ()
const;
79 INLINE
const char *c_str()
const;
80 INLINE
bool empty()
const;
81 INLINE
size_t length()
const;
82 INLINE
char operator [] (
int n)
const;
84 bool input(istream &in);
85 void output(ostream &out)
const;
87 static string quote(
const string &source,
const string &safe =
"/");
88 static string quote_plus(
const string &source,
const string &safe =
"/");
89 static string unquote(
const string &source);
90 static string unquote_plus(
const string &source);
93 void parse_authority();
96 F_has_scheme = 0x0001,
97 F_has_authority = 0x0002,
98 F_has_username = 0x0004,
99 F_has_server = 0x0008,
102 F_has_query = 0x0040,
110 size_t _username_start;
111 size_t _username_end;
112 size_t _server_start;
121 INLINE istream &operator >> (istream &in,
URLSpec &url);
122 INLINE ostream &operator << (ostream &out,
const URLSpec &url);
A container for a URL, e.g.
An STL function object class, this is intended to be used on any ordered collection of class objects ...