lib/vpwentry/to.cc
changeset 0 6f7a81934006
child 2 b3afb9f1e801
equal deleted inserted replaced
-1:000000000000 0:6f7a81934006
       
     1 // Copyright (C) 1999,2000 Bruce Guenter <bruceg@em.ca>
       
     2 //
       
     3 // This program is free software; you can redistribute it and/or modify
       
     4 // it under the terms of the GNU General Public License as published by
       
     5 // the Free Software Foundation; either version 2 of the License, or
       
     6 // (at your option) any later version.
       
     7 //
       
     8 // This program is distributed in the hope that it will be useful,
       
     9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    11 // GNU General Public License for more details.
       
    12 //
       
    13 // You should have received a copy of the GNU General Public License
       
    14 // along with this program; if not, write to the Free Software
       
    15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
       
    16 
       
    17 #include <config.h>
       
    18 #include "vpwentry.h"
       
    19 #include "misc/utoa.h"
       
    20 #include "vdomain/vdomain.h"
       
    21 
       
    22 mystring vpwentry::to_record() const
       
    23 {
       
    24   static const mystring prefix = "\02";
       
    25   
       
    26   mystring f;
       
    27   if(!!forwards)
       
    28     f = forwards + mystring::NUL;
       
    29   char flagstmp[] = {
       
    30     vdomain::ATTR_MAILBOX_ENABLED,
       
    31     is_mailbox_enabled,
       
    32     0
       
    33   };
       
    34   mystring flags(flagstmp, 3);
       
    35   return prefix + flags + pass + mystring::NUL +
       
    36     mailbox + mystring::NUL +
       
    37     f + mystring::NUL +
       
    38     personal + mystring::NUL +
       
    39     utoa(hardquota) + mystring::NUL +
       
    40     utoa(softquota) + mystring::NUL +
       
    41     utoa(msgsize) + mystring::NUL +
       
    42     utoa(msgcount) + mystring::NUL +
       
    43     utoa(ctime) + mystring::NUL +
       
    44     utoa(expiry) + mystring::NUL /* + data.str() + mystring::NUL */ ;
       
    45 }