Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

GroupInfo Class Reference

#include <GroupInfo.h>

List of all members.

Public Member Functions

 GroupInfo ()
 GroupInfo (const char *gd)
void init ()
void setraw (const char *buf, unsigned int bufsz)
void getraw (const char **buf, unsigned int *bufsz)
void set (const char *gd)
void set (const char *group, int fst, int lst, int n, char fl= 'y')
void setfln (int first, int last, int n, char fl= 'y')
void setflag (char fl)
void setctime (nvtime_t ctime)
nvtime_t ctime () const
nvtime_t mtime () const
const char * name () const
unsigned int first () const
unsigned int last () const
unsigned int n () const
char flags () const

Private Attributes

nvtime_t _ctime
nvtime_t _mtime
unsigned int _fst
unsigned int _lst
unsigned int _n
char _flag
char _name [512]

Friends

std::ostream & operator<< (std::ostream &os, const GroupInfo &gd)


Detailed Description

Author:
Thomas Gschwind

Bug:
Documentation is missing.

Definition at line 15 of file GroupInfo.h.


Constructor & Destructor Documentation

GroupInfo::GroupInfo  )  [inline]
 

Definition at line 23 of file GroupInfo.h.

References init().

00023                      {
00024                 init();
00025         } GroupInfo(const char *gd) {

GroupInfo::GroupInfo const char *  gd  )  [inline]
 

Definition at line 25 of file GroupInfo.h.

00025                                     {
00026                 _name[sizeof(_name) - 1] = '\0';
00027                 set(gd);
00028         }


Member Function Documentation

nvtime_t GroupInfo::ctime  )  const [inline]
 

Definition at line 115 of file GroupInfo.h.

References _ctime, and nvtime_t.

Referenced by active_filter_time< Format >::operator()(), active_filter_group_time< Format >::operator()(), and NVActiveDB::write().

00115                                {
00116                 return _ctime;
00117         } nvtime_t mtime() const {

unsigned int GroupInfo::first  )  const [inline]
 

Definition at line 121 of file GroupInfo.h.

Referenced by CServer::getgroup(), RServer::getgroup(), ns_group(), selectgroup(), and CNewsgroup::sUpdateGroupInfo().

00121                                      {
00122                 return _fst;
00123         } unsigned int last() const {

char GroupInfo::flags  )  const [inline]
 

Definition at line 127 of file GroupInfo.h.

00127                              {
00128                 return _flag;
00129         } friend std::ostream & operator <<(std::ostream & os,

void GroupInfo::getraw const char **  buf,
unsigned int *  bufsz
[inline]
 

Definition at line 47 of file GroupInfo.h.

References _ctime, _flag, _fst, _lst, _mtime, _n, and _name.

Referenced by NVActiveDB::add(), and NVActiveDB::sset().

00047                                                            {
00048                 *buf = (const char *) this;
00049                 *bufsz = sizeof(_ctime) + sizeof(_mtime) +
00050                     sizeof(_fst) + sizeof(_lst) + sizeof(_n) +
00051                     sizeof(_flag) + strlen(_name) + 1;
00052         }

void GroupInfo::init  )  [inline]
 

Definition at line 30 of file GroupInfo.h.

References _ctime, _flag, _mtime, and _name.

Referenced by GroupInfo(), RServer::setserver(), and RServer::setserverlist().

00030                     {
00031                 _ctime = _mtime = 0;
00032                 _name[0] = _name[sizeof(_name) - 1] = '\0';
00033                 _flag = 'y';
00034         }

unsigned int GroupInfo::last  )  const [inline]
 

Definition at line 123 of file GroupInfo.h.

Referenced by CServer::getgroup(), RServer::getgroup(), ns_group(), selectgroup(), and CNewsgroup::sUpdateGroupInfo().

00123                                     {
00124                 return _lst;
00125         } unsigned int n() const {

nvtime_t GroupInfo::mtime  )  const [inline]
 

Definition at line 117 of file GroupInfo.h.

Referenced by CServer::groupinfo().

00117                                  {
00118                 return _mtime;
00119         } const char *name() const {

unsigned int GroupInfo::n  )  const [inline]
 

Definition at line 125 of file GroupInfo.h.

Referenced by ns_group().

00125                                  {
00126                 return _n;
00127         } char flags() const {

const char* GroupInfo::name  )  const [inline]
 

Definition at line 119 of file GroupInfo.h.

Referenced by NVActiveDB::add(), RServer::connect(), ns_group(), active_filter_group_time< Format >::operator()(), active_filter_group< Format >::operator()(), RServer::selectgroup(), NVActiveDB::sset(), and NVActiveDB::write().

00119                                    {
00120                 return _name;
00121         } unsigned int first() const {

void GroupInfo::set const char *  group,
int  fst,
int  lst,
int  n,
char  fl = 'y'
[inline]
 

Definition at line 89 of file GroupInfo.h.

References _name, ERROR_LOCATION, and setfln().

00089                                                                             {
00090                 strncpy(_name, group, sizeof(_name));
00091                 if (_name[sizeof(_name) - 1] != '\0')
00092                         throw Error("Name of newsgroup too long",
00093                                     ERROR_LOCATION);
00094                 setfln(fst, lst, n, fl);
00095         }

void GroupInfo::set const char *  gd  )  [inline]
 

Definition at line 54 of file GroupInfo.h.

References _flag, _fst, _lst, _mtime, _n, _name, ERROR_LOCATION, and nvtime().

Referenced by NVActiveDB::read(), and RServer::selectgroup().

00054                                  {
00055                 const char *p = gd, *e;
00056                 char *q = _name;
00057                 unsigned int i = 0;
00058 
00059                 while (i < sizeof(_name) && !isspace(*p)) {
00060                         *q++ = *p++;
00061                         ++i;
00062                 }
00063                 if (i == sizeof(_name))
00064                         throw Error("Name of newsgroup too long",
00065                                     ERROR_LOCATION);
00066                 *q = '\0';
00067 
00068                 _lst = strtol(p, (char **) &e, 10);
00069                 _fst = strtol(e, (char **) &p, 10);
00070                 if (e == p)
00071                         throw NSError("gd not in form name int int flag",
00072                                       ERROR_LOCATION);
00073 
00074                 if (_fst > _lst)
00075                         _n = 0;
00076                 else
00077                         _n = _lst - _fst + 1;
00078 
00079                 while (isspace(*p))
00080                         p++;
00081                 if (*p)
00082                         _flag = *p;
00083                 else
00084                         _flag = 'y';
00085 
00086                 nvtime(&_mtime);
00087         }

void GroupInfo::setctime nvtime_t  ctime  )  [inline]
 

Definition at line 111 of file GroupInfo.h.

References _ctime, and nvtime_t.

Referenced by NVActiveDB::sset().

00111                                       {
00112                 _ctime = ctime;
00113         }

void GroupInfo::setflag char  fl  )  [inline]
 

Definition at line 107 of file GroupInfo.h.

References _flag.

Referenced by NVActiveDB::read().

00107                               {
00108                 _flag = fl;
00109         }

void GroupInfo::setfln int  first,
int  last,
int  n,
char  fl = 'y'
[inline]
 

Definition at line 97 of file GroupInfo.h.

References _flag, _fst, _lst, _mtime, _n, nvtime(), and nvtime_t.

Referenced by set().

00097                                                                {
00098                 nvtime_t tm;
00099                 _fst = first;
00100                 _lst = last;
00101                 _n = n;
00102                 if (fl)
00103                         _flag = fl;
00104                 nvtime(&tm);
00105                 _mtime = tm;
00106         }

void GroupInfo::setraw const char *  buf,
unsigned int  bufsz
[inline]
 

Definition at line 38 of file GroupInfo.h.

References _ctime, _flag, _fst, _lst, _mtime, _n, _name, and ERROR_LOCATION.

Referenced by NVActiveDB_Iter::get(), NVActiveDB::get(), and NVActiveDB::write().

00038                                                          {
00039                 if (bufsz > sizeof(_ctime) + sizeof(_mtime) +
00040                     sizeof(_fst) + sizeof(_lst) + sizeof(_n) +
00041                     sizeof(_flag) + sizeof(_name))
00042                         throw Error("GroupInfo(24230): setraw buf too big",
00043                                     ERROR_LOCATION);
00044                 memcpy(this, buf, bufsz);
00045         }


Friends And Related Function Documentation

std::ostream& operator<< std::ostream &  os,
const GroupInfo gd
[friend]
 

Definition at line 129 of file GroupInfo.h.

00130                                                                   {
00131                 os << gd._name << ' ' << gd._lst << ' ' << gd.
00132                     _fst << ' ' << gd._flag;
00133                 return os;
00134         }


Member Data Documentation

nvtime_t GroupInfo::_ctime [private]
 

Definition at line 16 of file GroupInfo.h.

Referenced by ctime(), getraw(), init(), setctime(), and setraw().

char GroupInfo::_flag [private]
 

Definition at line 19 of file GroupInfo.h.

Referenced by getraw(), init(), set(), setflag(), setfln(), and setraw().

unsigned int GroupInfo::_fst [private]
 

Definition at line 18 of file GroupInfo.h.

Referenced by getraw(), set(), setfln(), and setraw().

unsigned int GroupInfo::_lst [private]
 

Definition at line 18 of file GroupInfo.h.

Referenced by getraw(), set(), setfln(), and setraw().

nvtime_t GroupInfo::_mtime [private]
 

Definition at line 17 of file GroupInfo.h.

Referenced by getraw(), init(), set(), setfln(), and setraw().

unsigned int GroupInfo::_n [private]
 

Definition at line 18 of file GroupInfo.h.

Referenced by getraw(), set(), setfln(), and setraw().

char GroupInfo::_name[512] [private]
 

Definition at line 20 of file GroupInfo.h.

Referenced by getraw(), init(), set(), and setraw().


The documentation for this class was generated from the following file:
Generated on Fri Aug 20 10:58:10 2004 for NewsCache by doxygen 1.3.6-20040222