Logo Search packages:      
Sourcecode: pwlib version File versions  Download package

PINDEX PInternetProtocol::ParseResponse ( const PString line ) [protected, virtual, inherited]

Parse a response line string into a response code and any extra info on the line. Results are placed into the member variables lastResponseCode and lastResponseInfo.

The default bahaviour looks for a space or a '-' and splits the code and info either side of that character, then returns FALSE.

Returns:
Position of continuation character in response, 0 if no continuation lines are possible.
Parameters:
lineInput response line to be parsed

Reimplemented in PHTTP, and PPOP3.

Definition at line 648 of file inetprot.cxx.

References PString::AsInteger(), PString::FindOneOf(), PString::Left(), and PString::Mid().

Referenced by PInternetProtocol::ReadResponse().

{
  PINDEX endCode = line.FindOneOf(" -");
  if (endCode == P_MAX_INDEX) {
    lastResponseCode = -1;
    lastResponseInfo = line;
    return 0;
  }

  lastResponseCode = line.Left(endCode).AsInteger();
  lastResponseInfo = line.Mid(endCode+1);
  return line[endCode] != ' ' ? endCode : 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index