TekUserDBUnix Class Reference

Inheritance diagram for TekUserDBUnix:

Inheritance graph
[legend]
Collaboration diagram for TekUserDBUnix:

Collaboration graph
[legend]
List of all members.

Public Member Functions

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

Detailed Description

Contains the TekUserDB format for user information stored inside a /etc/passwd .

This interface is FINAL.

Author:
Kevin McBride

Definition at line 35 of file tekuserdbunix.h.


Member Function Documentation

TEKERR Back void **  RetVal  )  [virtual]
 

Goes backward by an element.

Implements TekUserDB.

Definition at line 58 of file TekUserDBUnix.cpp.

TEKERR Clone TekEnum **  RetVal  )  [virtual]
 

Clones the current enumeration.

Implements TekUserDB.

Definition at line 48 of file TekUserDBUnix.cpp.

TEKERR Close  )  [virtual]
 

Closes the user database.

Implements TekUserDB.

Definition at line 108 of file TekUserDBUnix.cpp.

TEKERR DeleteUser TekUser UserInfo  )  [virtual]
 

Deletes a user from the opened user database.

Implements TekUserDB.

Definition at line 223 of file TekUserDBUnix.cpp.

TEKERR DeleteUsers const uchar_t SearchString,
TekUserDBFunc *  FuncToCall,
struct TekArray **  RetVal
[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.

Implements TekUserDB.

Definition at line 267 of file TekUserDBUnix.cpp.

TEKERR EnumNo unsigned long  ItemNo  )  [virtual]
 

Retrieves a particular element in the enum.

Implements TekUserDB.

Definition at line 68 of file TekUserDBUnix.cpp.

TEKERR FindUser const uchar_t Username,
TekUser RetVal
[virtual]
 

Looks for a user in the opened user database.

Implements TekUserDB.

Definition at line 139 of file TekUserDBUnix.cpp.

TEKERR FindUsers const uchar_t SearchString,
TekUserDBFunc *  FuncToCall,
struct TekArray **  RetVal
[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.

Implements TekUserDB.

Definition at line 178 of file TekUserDBUnix.cpp.

TEKERR FindUsersFree TekUser **  UserInfoArray  )  [virtual]
 

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

Implements TekUserDB.

Definition at line 193 of file TekUserDBUnix.cpp.

TEKERR Flush  )  [virtual]
 

Writes everything to the user database.

Implements TekUserDB.

Definition at line 118 of file TekUserDBUnix.cpp.

TEKERR get_FileInterfaceUUID uuid_t *  FileUUID  )  [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.

Implements TekUserDB.

Definition at line 317 of file TekUserDBUnix.cpp.

TEKERR get_Filename uchar_t **  Filename  )  [virtual]
 

Retrieves the filename to access.

Implements TekUserDB.

Definition at line 293 of file TekUserDBUnix.cpp.

TEKERR get_GenericFileType TekFileType *  CurrentFileType  )  [virtual]
 

Retrieves the generic file type, if available.

Implements TekUserDB.

Definition at line 337 of file TekUserDBUnix.cpp.

TEKERR get_ReadOnly bool *  ReadOnlyStat  )  [virtual]
 

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

Implements TekUserDB.

Definition at line 303 of file TekUserDBUnix.cpp.

TEKERR Next void **  RetVal  )  [virtual]
 

Retrieves the next item in the enum.

Implements TekUserDB.

Definition at line 78 of file TekUserDBUnix.cpp.

TEKERR Open  )  [virtual]
 

Opens the user database.

Implements TekUserDB.

Definition at line 98 of file TekUserDBUnix.cpp.

TEKERR OpenAndLoadAll  )  [virtual]
 

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

Implements TekUserDB.

Definition at line 129 of file TekUserDBUnix.cpp.

TEKERR put_FileInterfaceUUID const uuid_t *  FileUUID  )  [virtual]
 

Sets the uuid of the interface to access.

Implements TekUserDB.

Definition at line 327 of file TekUserDBUnix.cpp.

TEKERR put_Filename const uchar_t NewFilename  )  [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.

Implements TekUserDB.

Definition at line 283 of file TekUserDBUnix.cpp.

TEKERR put_GenericFileType TekFileType  CurrentFileType  )  [virtual]
 

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

Implements TekUserDB.

Definition at line 347 of file TekUserDBUnix.cpp.

TEKERR Reset  )  [virtual]
 

Resets the current item pointer.

Implements TekUserDB.

Definition at line 88 of file TekUserDBUnix.cpp.

TEKERR WriteUser TekUser UserInfo  )  [virtual]
 

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

Implements TekUserDB.

Definition at line 213 of file TekUserDBUnix.cpp.

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

Writes users in the opened user database from an array.

Implements TekUserDB.

Definition at line 203 of file TekUserDBUnix.cpp.


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