oasys::URL Class Reference

#include <URL.h>

List of all members.


Detailed Description

A simple class for managing internet style URLs.

Definition at line 42 of file URL.h.

std::string url_
std::string proto_
std::string host_
u_int16_t port_
std::string path_
urlerr_t err_
const char * c_str () const
 Wrappers around some basic std::string accessors to simplify things.
const char * data () const
size_t length () const
urlerr_t parse_internal ()

Public Member Functions

 URL ()
 Default constructor.
 URL (const std::string &url)
 Construct the url from the given std::string.
 URL (const char *url)
 Construct the url from the given std::string.
 URL (const URL &copy)
 Deep copy constructor.
void clear ()
 Clear out this url.
urlerr_t parse ()
 Parse the internal url_ into its constituent parts.
urlerr_t parse (const std::string &url)
 Parse the internal url_ into its constituent parts.
void format (const std::string &proto, const std::string &host, u_int16_t port, const std::string &path)
 Cons up this url from constituent pieces.
urlerr_t status () const
 Return the result of the parse operation.
bool valid () const
 Return an indication of whether or not this url is valid.

Constructor & Destructor Documentation

oasys::URL::URL (  )  [inline]

Default constructor.

Definition at line 47 of file URL.h.

References clear().

oasys::URL::URL ( const std::string &  url  )  [inline]

Construct the url from the given std::string.

Definition at line 55 of file URL.h.

References parse(), and url_.

oasys::URL::URL ( const char *  url  )  [inline]

Construct the url from the given std::string.

Definition at line 64 of file URL.h.

References parse(), and url_.

oasys::URL::URL ( const URL copy  )  [inline]

Deep copy constructor.

Definition at line 73 of file URL.h.


Member Function Documentation

void oasys::URL::clear (  )  [inline]

Clear out this url.

Definition at line 86 of file URL.h.

References err_, url_, and oasys::URLPARSE_UNPARSED.

Referenced by URL().

urlerr_t oasys::URL::parse (  ) 

Parse the internal url_ into its constituent parts.

Definition at line 105 of file URL.cc.

References err_, and parse_internal().

Referenced by parse(), and URL().

urlerr_t oasys::URL::parse ( const std::string &  url  )  [inline]

Parse the internal url_ into its constituent parts.

Definition at line 100 of file URL.h.

References parse(), and url_.

void oasys::URL::format ( const std::string &  proto,
const std::string &  host,
u_int16_t  port,
const std::string &  path 
)

Cons up this url from constituent pieces.

Definition at line 112 of file URL.cc.

References oasys::StringBuffer::append(), oasys::StringBuffer::appendf(), oasys::StringBuffer::data(), err_, host_, oasys::StringBuffer::length(), path_, port_, proto_, url_, and oasys::URLPARSE_OK.

urlerr_t oasys::URL::status (  )  const [inline]

Return the result of the parse operation.

Definition at line 116 of file URL.h.

References err_.

bool oasys::URL::valid (  )  const [inline]

Return an indication of whether or not this url is valid.

Definition at line 124 of file URL.h.

References err_, and oasys::URLPARSE_OK.

Referenced by dtn::FileConvergenceLayer::extract_dir(), dtn::TCAScheme::validate(), and dtn::DTNScheme::validate().

const char* oasys::URL::c_str (  )  const [inline]

Wrappers around some basic std::string accessors to simplify things.

Definition at line 134 of file URL.h.

References url_.

const char* oasys::URL::data (  )  const [inline]

Definition at line 135 of file URL.h.

References url_.

size_t oasys::URL::length (  )  const [inline]

Definition at line 136 of file URL.h.

References url_.

urlerr_t oasys::URL::parse_internal (  )  [protected]

Definition at line 25 of file URL.cc.

References ASSERT, end, host_, path_, port_, proto_, url_, oasys::URLPARSE_BADPORT, oasys::URLPARSE_BADPROTO, oasys::URLPARSE_BADSEP, oasys::URLPARSE_NOHOST, and oasys::URLPARSE_OK.

Referenced by parse().


Member Data Documentation

std::string oasys::URL::url_

Definition at line 143 of file URL.h.

Referenced by c_str(), clear(), data(), format(), length(), parse(), parse_internal(), and URL().

std::string oasys::URL::proto_

Definition at line 144 of file URL.h.

Referenced by format(), and parse_internal().

std::string oasys::URL::host_

Definition at line 145 of file URL.h.

Referenced by dtn::FileConvergenceLayer::extract_dir(), format(), parse_internal(), dtn::TCAScheme::validate(), and dtn::DTNScheme::validate().

u_int16_t oasys::URL::port_

Definition at line 146 of file URL.h.

Referenced by dtn::FileConvergenceLayer::extract_dir(), format(), and parse_internal().

std::string oasys::URL::path_

Definition at line 147 of file URL.h.

Referenced by dtn::FileConvergenceLayer::extract_dir(), format(), and parse_internal().

urlerr_t oasys::URL::err_

Definition at line 149 of file URL.h.

Referenced by clear(), format(), parse(), status(), and valid().


The documentation for this class was generated from the following files:
Generated on Sat Sep 8 08:43:56 2007 for DTN Reference Implementation by  doxygen 1.5.3