Logo Search packages:      
Sourcecode: pwlib version File versions

PString PURL::AsString ( UrlFormat  fmt = FullURL  )  const

Convert the URL object into its string representation. The parameter indicates whether a full or partial representation os to be produced.

Returns:
String representation of the URL.
Parameters:
fmt  The type of string to be returned.

Definition at line 964 of file http.cxx.

References PString::Empty(), FullURL, and PString::IsEmpty().

Referenced by PHTTPClient::GetDocument().

{
  if (fmt == FullURL)
    return urlString;

  if (scheme.IsEmpty())
    return PString::Empty();

  //const schemeStruct * schemeInfo = GetSchemeInfo(scheme);
  //if (schemeInfo == NULL)
  //  schemeInfo = &SchemeTable[PARRAYSIZE(SchemeTable)-1];
  const PURLScheme * schemeInfo = PFactory<PURLScheme>::CreateInstance(scheme);
  if (schemeInfo == NULL)
    schemeInfo = PFactory<PURLScheme>::CreateInstance(DEFAULT_SCHEME);

  return schemeInfo->AsString(fmt, *this);
}


Generated by  Doxygen 1.6.0   Back to index