WvStreams
Main Page
Modules
Classes
Files
File List
File Members
include
wvurl.h
1
/* -*- Mode: C++ -*-
2
* Worldvisions Weaver Software:
3
* Copyright (C) 1997-2002 Net Integration Technologies, Inc.
4
*
5
* WvURL is a simple URL-parsing class with built-in (though still somewhat
6
* inconvenient) DNS resolution.
7
*/
8
#ifndef __WVURL_H
9
#define __WVURL_H
10
11
#include "wvstring.h"
12
#include "wvresolver.h"
13
14
class
WvIPPortAddr
;
15
16
class
WvUrl
17
{
18
public
:
19
WvUrl
(
WvStringParm
url);
20
WvUrl
(
const
WvUrl
&url);
21
~
WvUrl
();
22
23
bool
isok()
const
24
{
return
port != 0 && (resolving || addr != NULL); }
25
WvStringParm
errstr()
const
26
{
return
err; }
27
bool
resolve();
// dns-resolve the hostname (returns true if done)
28
29
operator
WvString
()
const
;
30
31
// not actually defined - this just prevents accidental copying
32
const
WvUrl
&operator= (
const
WvUrl
&);
33
34
WvStringParm
getproto()
const
35
{
return
proto; }
36
37
// this one is ONLY valid if resolve() returns true!
38
const
WvIPPortAddr
getaddr()
const
39
{
return
addr ? *addr :
WvIPPortAddr
(); }
40
41
WvStringParm
getfile()
const
42
{
return
file; }
43
WvStringParm
gethost()
const
44
{
return
hostname; }
45
int
getport()
const
46
{
return
port; }
47
WvStringParm
getuser()
const
48
{
return
user; }
49
WvStringParm
getpassword()
const
50
{
return
password; }
51
52
protected
:
53
WvString
proto, hostname, user, password;
54
int
port;
55
bool
resolving;
56
WvResolver
dns;
57
WvIPPortAddr
*addr;
58
WvString
file, err;
59
};
60
61
62
// backwards compatibility
63
typedef
WvUrl
WvURL
;
64
65
#endif // __WVURL_H
Generated on Fri Mar 15 2013 00:01:37 for WvStreams by
1.8.3.1