TekUserDB Class Reference

Inheritance diagram for TekUserDB:

Inheritance graph
[legend]
Collaboration diagram for TekUserDB:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 TekUserDB ()
 ~TekUserDB ()
virtual TEKERR Clone (TekEnum **RetVal)=0
virtual TEKERR Back (void **RetVal)=0
virtual TEKERR EnumNo (unsigned long ItemNo)=0
virtual TEKERR Next (void **RetVal)=0
virtual TEKERR Reset ()=0
virtual TEKERR Open ()=0
virtual TEKERR Close ()=0
virtual TEKERR Flush ()=0
virtual TEKERR OpenAndLoadAll ()=0
virtual TEKERR FindUser (const uchar_t *Username, TekUser *RetVal)=0
virtual TEKERR FindUsers (const uchar_t *SearchString, TekUserDBFunc *FuncToCall, struct TekArray **RetVal=NULL)=0
virtual TEKERR FindUsersFree (TekUser **UserInfoArray)=0
virtual TEKERR WriteUsers (TekUser **UserInfoArray, unsigned long Count)=0
virtual TEKERR WriteUser (TekUser *UserInfo)=0
virtual TEKERR DeleteUser (TekUser *UserInfo)=0
virtual TEKERR DeleteUsers (const uchar_t *SearchString, TekUserDBFunc *FuncToCall, struct TekArray **RetVal=NULL)=0
virtual TEKERR put_Filename (const uchar_t *NewFilename)=0
virtual TEKERR get_Filename (uchar_t **Filename)=0
virtual TEKERR get_ReadOnly (bool *ReadOnlyStat)=0
virtual TEKERR get_FileInterfaceUUID (uuid_t *FileUUID)=0
virtual TEKERR put_FileInterfaceUUID (const uuid_t *FileUUID)=0
virtual TEKERR get_GenericFileType (TekFileType *CurrentFileType)=0
virtual TEKERR put_GenericFileType (TekFileType CurrentFileType)=0

Detailed Description

This provides the generic interface for accessing a system's user database.

This interface is INHERITABLE.

Author:
Kevin McBride

Definition at line 43 of file tekuserdb.h.


Constructor & Destructor Documentation

TekUserDB  ) 
 

Instantizer.

Definition at line 57 of file TekUserDB.cpp.

~TekUserDB  ) 
 

Destructor.

Definition at line 66 of file TekUserDB.cpp.


Member Function Documentation

TEKERR Back void **  RetVal  )  [pure virtual]
 

Goes backward by an element.

Implements TekEnum.

Implemented in TekUserDBUnix.

Definition at line 90 of file TekUserDB.cpp.

TEKERR Clone TekEnum **  RetVal  )  [pure virtual]
 

Clones the current enumeration.

Implements TekEnum.

Implemented in TekUserDBUnix.

Definition at line 80 of file TekUserDB.cpp.

TEKERR Close  )  [pure virtual]
 

Closes the user database.

Implemented in TekUserDBUnix.

Definition at line 140 of file TekUserDB.cpp.

TEKERR DeleteUser TekUser UserInfo  )  [pure virtual]
 

Deletes a user from the opened user database.

Implemented in TekUserDBUnix.

Definition at line 255 of file TekUserDB.cpp.

TEKERR DeleteUsers const uchar_t SearchString,
TekUserDBFunc *  FuncToCall,
struct TekArray **  RetVal = NULL
[pure virtual]
 

Deletes users in the opened user database that match the query string.

Query format is standardized as follows:

BOOLEAN syntax is used, so you may use AND and OR operators in the query, as well as the * wildcard.

In addition, NULL characters will be accepted, so be careful with NULLs.

Username=username
The username to look for. Use double quotes for usernames with spaces.

ID=userid
the user id to look for

There might be more supported by inheriting interfaces.


This function can call a user-defined callback function on every failed deletion, return an array of users that were successfully deleted, or both. Unlike FindUsers(), this function will not fail if both FuncToCall and RetVal are NULL, unless one of the following happen:

  • A catastrophic error occurs
  • No users matched the query string
  • The user executing this function does not have write access to the DB.
    The TekUserDBFunc callback implementation standard is:
    int TekUserDBFunc(TekUser *) {}
    The called function can view the TekUser * variable, and from there, decide what to do with it. However, the return value must be one of the following:

  • 0 - to stop the search and deletion.
  • 1 - to continue on with the search and deletion.

Implemented in TekUserDBUnix.

Definition at line 299 of file TekUserDB.cpp.

TEKERR EnumNo unsigned long  ItemNo  )  [pure virtual]
 

Retrieves a particular element in the enum.

Implements TekEnum.

Implemented in TekUserDBUnix.

Definition at line 100 of file TekUserDB.cpp.

TEKERR FindUser const uchar_t Username,
TekUser RetVal
[pure virtual]
 

Looks for a user in the opened user database.

Implemented in TekUserDBUnix.

Definition at line 171 of file TekUserDB.cpp.

TEKERR FindUsers const uchar_t SearchString,
TekUserDBFunc *  FuncToCall,
struct TekArray **  RetVal = NULL
[pure virtual]
 

Looks for users in the opened user database matching the query string.

Query format is standardized as follows:

BOOLEAN syntax is used, so you may use AND and OR operators in the query, as well as the * wildcard.

In addition, NULL characters will be accepted, so be careful with NULLs.

Username=username
The username to look for. Use double quotes for usernames with spaces.

ID=userid
the user id to look for

There might be more supported by inheriting interfaces.


This function can call a user-defined callback function on every successful match, return an array of users, or both. However, this function will return TEKERR_POINTER if both FuncToCall and RetVal are NULL.

The TekUserDBFunc callback implementation standard is:
int TekUserDBFunc(TekUser *) {} The called function can view the TekUser * variable, and from there, decide what to do with it. However, the return value must be one of the following:

  • 0 - to stop the search.
  • 1 - to continue on with the search.

Implemented in TekUserDBUnix.

Definition at line 210 of file TekUserDB.cpp.

TEKERR FindUsersFree TekUser **  UserInfoArray  )  [pure virtual]
 

Frees a UserInfoArray. This function should always be called to destroy the array.

Implemented in TekUserDBUnix.

Definition at line 225 of file TekUserDB.cpp.

TEKERR Flush  )  [pure virtual]
 

Writes everything to the user database.

Implemented in TekUserDBUnix.

Definition at line 150 of file TekUserDB.cpp.

TEKERR get_FileInterfaceUUID uuid_t *  FileUUID  )  [pure virtual]
 

Retrieves the uuid of the interface to access.

NOTE: On unknown final interfaces, you should first attempt to use get_GenericFileType first. It is more efficient in the long run, in most cases.

Implemented in TekUserDBUnix.

Definition at line 349 of file TekUserDB.cpp.

TEKERR get_Filename uchar_t **  Filename  )  [pure virtual]
 

Retrieves the filename to access.

Implemented in TekUserDBUnix.

Definition at line 325 of file TekUserDB.cpp.

TEKERR get_GenericFileType TekFileType *  CurrentFileType  )  [pure virtual]
 

Retrieves the generic file type, if available.

Implemented in TekUserDBUnix.

Definition at line 369 of file TekUserDB.cpp.

TEKERR get_ReadOnly bool *  ReadOnlyStat  )  [pure virtual]
 

Retrieves the read-only status of the entire User DB.

Implemented in TekUserDBUnix.

Definition at line 335 of file TekUserDB.cpp.

TEKERR Next void **  RetVal  )  [pure virtual]
 

Retrieves the next item in the enum.

Implements TekEnum.

Implemented in TekUserDBUnix.

Definition at line 110 of file TekUserDB.cpp.

TEKERR Open  )  [pure virtual]
 

Opens the user database.

Implemented in TekUserDBUnix.

Definition at line 130 of file TekUserDB.cpp.

TEKERR OpenAndLoadAll  )  [pure virtual]
 

Opens the user database and loads the database into a temporary file or directly into memory.

Implemented in TekUserDBUnix.

Definition at line 161 of file TekUserDB.cpp.

TEKERR put_FileInterfaceUUID const uuid_t *  FileUUID  )  [pure virtual]
 

Sets the uuid of the interface to access.

Implemented in TekUserDBUnix.

Definition at line 359 of file TekUserDB.cpp.

TEKERR put_Filename const uchar_t NewFilename  )  [pure virtual]
 

Sets the filename to access. If this is not set before Open() is called, the inheriting interfaces can choose a default filename, or fail.

Implemented in TekUserDBUnix.

Definition at line 315 of file TekUserDB.cpp.

TEKERR put_GenericFileType TekFileType  CurrentFileType  )  [pure virtual]
 

Sets the generic file type, if allowed by the inheriting interface.

Implemented in TekUserDBUnix.

Definition at line 379 of file TekUserDB.cpp.

TEKERR Reset  )  [pure virtual]
 

Resets the current item pointer.

Implements TekEnum.

Implemented in TekUserDBUnix.

Definition at line 120 of file TekUserDB.cpp.

TEKERR WriteUser TekUser UserInfo  )  [pure virtual]
 

Writes a new user or updates one in the opened user database.

Implemented in TekUserDBUnix.

Definition at line 245 of file TekUserDB.cpp.

Referenced by TekUserUnixRW::Save().

TEKERR WriteUsers TekUser **  UserInfoArray,
unsigned long  Count
[pure virtual]
 

Writes users in the opened user database from an array.

Implemented in TekUserDBUnix.

Definition at line 235 of file TekUserDB.cpp.


The documentation for this class was generated from the following files: SourceForge.net Logo  Technical Library Template Interface Project Page