2000-02-25 10:15:17 +00:00
|
|
|
// This may look like C code, but it is really -*- C++ -*-
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
// The Goldware Library
|
|
|
|
// Copyright (C) 1990-1999 Odinn Sorensen
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
// This library is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU Library General Public
|
|
|
|
// License as published by the Free Software Foundation; either
|
|
|
|
// version 2 of the License, or (at your option) any later version.
|
|
|
|
//
|
|
|
|
// This library is distributed in the hope that it will be useful,
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
|
|
// Library General Public License for more details.
|
|
|
|
//
|
|
|
|
// You should have received a copy of the GNU Library General Public
|
|
|
|
// License along with this program; if not, write to the Free
|
|
|
|
// Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,
|
|
|
|
// MA 02111-1307, USA
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
// $Id$
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
// Userfile base class.
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
|
|
|
#ifndef __gusrbase_h
|
|
|
|
#define __gusrbase_h
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
|
|
|
#include <gdefs.h>
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
// Userfile base class
|
|
|
|
|
|
|
|
class GUser {
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------
|
|
|
|
// Variables
|
|
|
|
|
2006-05-13 16:15:35 +00:00
|
|
|
int gufh; // File handle
|
2000-02-25 10:15:17 +00:00
|
|
|
int found; // User found
|
|
|
|
uint index; // User index number
|
|
|
|
char* name; // Pointer to name in user record
|
|
|
|
uint recno; // Current user record number
|
|
|
|
uint records; // Total number of user records
|
|
|
|
char* recptr; // Pointer to user record
|
|
|
|
uint recsize; // Size of user records
|
|
|
|
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------
|
|
|
|
// Constructor and destructor
|
|
|
|
|
|
|
|
GUser();
|
|
|
|
virtual ~GUser() = 0;
|
|
|
|
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------
|
|
|
|
// Pure virtual functions
|
|
|
|
|
|
|
|
virtual int isvalid() = 0;
|
|
|
|
virtual int read() = 0;
|
|
|
|
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------
|
|
|
|
// Virtual functions
|
|
|
|
|
2005-10-20 21:41:32 +00:00
|
|
|
virtual void founduser();
|
|
|
|
virtual void inctimesposted(int __times);
|
|
|
|
virtual uint32_t lastread();
|
|
|
|
virtual void lastread(uint32_t __lastread);
|
|
|
|
virtual void recinit(const char* __name);
|
2000-02-25 10:15:17 +00:00
|
|
|
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------
|
|
|
|
// Normal functions
|
|
|
|
|
|
|
|
int moveto(uint __rec);
|
|
|
|
int next();
|
|
|
|
int prev();
|
|
|
|
|
|
|
|
void seekread();
|
|
|
|
void seekwrite();
|
|
|
|
|
|
|
|
int find(const char* __name, char* __result=NULL, int __wildcards=false);
|
|
|
|
int findwild(const char* __name, char* __result=NULL);
|
|
|
|
|
|
|
|
void add(const char* __name);
|
|
|
|
|
|
|
|
|
|
|
|
// ----------------------------------------------------------------
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
// ------------------------------------------------------------------
|