Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Changeset 1383

Show
Ignore:
Timestamp:
01/24/07 19:26:18 (2 years ago)
Author:
qbert
Message:

Added commands stat, rset, noop

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/patches/proposals/Pop3Client.d

    r1382 r1383  
    1 module tango.net.pop3.Pop3
     1module tango.net.pop3.Pop3Client
    22 
    33private import tango.net.ftp.Telnet; 
    44private import tango.net.pop3.Exception; 
    55private import tango.text.convert.Integer; 
     6private import tango.text.Util; 
     7 
    68debug ( Pop3Debug ) { private import tango.io.Stdout; } 
    79 
     
    8082 
    8183    /// Delete a message on the server 
    82     POP3Response del(int messageNumber ) 
     84    POP3Response dele(int messageNumber ) 
    8385    { 
    8486    POP3Response r; 
     
    127129    } 
    128130   
    129   // Lists all messages on server and total size 
    130     POP3Response stat(inout uint totalMessages, inout totalSize) 
     131  /// Lists all messages on server and total size 
     132    POP3Response stat(inout uint totalMessages, inout uint totalSize) 
    131133    { 
    132134      POP3Response r; 
    133135      r.resp = shortCmd("STAT"); 
     136      char [] [] totalAndSize = delimit(r.resp," " ); 
     137 
     138      assert(totalAndSize.length == 3 ); 
     139 
     140      totalMessages = Integer.parse(totalAndSize[1] ); 
     141      totalSize = Integer.parse(totalAndSize[2] ); 
     142       
     143      return r; 
     144    } 
     145 
     146  /// Unmark all messages for deletion  
     147  POP3Response rset() 
     148    { 
     149      POP3Response r; 
     150      r.resp = shortCmd("RSET"); 
     151      return r; 
     152 
     153    } 
     154 
     155 
     156  /// NOOP for keepalive 
     157  POP3Response noop() 
     158    { 
     159      POP3Response r; 
     160      r.resp = shortCmd("NOOP"); 
     161      return r; 
    134162 
    135163    }