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

BOOL PInternetProtocol::WriteLine ( const PString line  )  [virtual, inherited]

Write a string to the socket channel followed by a CR/LF pair. If there are any lone CR or LF characters in the line parameter string, then these are translated into CR/LF pairs.

TRUE if the string and CR/LF were completely written.
line  String to write as a command line.

Definition at line 422 of file inetprot.cxx.

References PString::FindOneOf(), PString::Lines(), and PChannel::WriteString().

Referenced by PPOP3Client::LogIn(), PPOP3Server::OnLIST(), PPOP3Server::OnUIDL(), and PInternetProtocol::WriteCommand().

  if (line.FindOneOf(CRLF) == P_MAX_INDEX)
    return WriteString(line + CRLF);

  PStringArray lines = line.Lines();
  for (PINDEX i = 0; i < lines.GetSize(); i++)
    if (!WriteString(lines[i] + CRLF))
      return FALSE;

  return TRUE;

Generated by  Doxygen 1.6.0   Back to index