kpilot/lib
pilotUser.h00001 #ifndef _KPILOT_PILOTUSER_H
00002 #define _KPILOT_PILOTUSER_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032 #include <stdlib.h>
00033 #include <string.h>
00034 #include <time.h>
00035
00036 #include <pi-dlp.h>
00037
00038 class KPilotUser
00039 {
00040 public:
00041 KPilotUser() { ::memset(&fUser,0,sizeof(struct PilotUser)); }
00042 KPilotUser(const PilotUser* user) { fUser = *user; }
00043
00044 PilotUser *pilotUser() { return &fUser; }
00045
00046 const char* getUserName() const { return fUser.username; }
00047 void setUserName(const char* name)
00048 {
00049 memset(&fUser.username, 0, sizeof(fUser.username));
00050 strlcpy(fUser.username, name,sizeof(fUser.username));
00051 }
00052
00053 const int getPasswordLength() const { return fUser.passwordLength; }
00054 const char* getPassword() const { return fUser.password; }
00055 void setPassword(char* password)
00056 {
00057 memset(&fUser.password, 0, sizeof(fUser.password));
00058 strlcpy(fUser.password, password,sizeof(fUser.password));
00059 fUser.passwordLength = strlen(fUser.password);
00060 }
00061
00062 unsigned long getUserID() const { return fUser.userID; }
00063 unsigned long getViewerID() const { return fUser.viewerID; }
00064
00065 unsigned long getLastSyncPC() const { return fUser.lastSyncPC; }
00066 void setLastSyncPC(unsigned long pc) { fUser.lastSyncPC = pc; }
00067
00068 time_t getLastSuccessfulSyncDate() { return fUser.successfulSyncDate; }
00069 void setLastSuccessfulSyncDate(time_t when)
00070 { fUser.successfulSyncDate = when; }
00071
00072 time_t getLastSyncDate() { return fUser.lastSyncDate; }
00073 void setLastSyncDate(time_t when) { fUser.lastSyncDate = when; }
00074
00075 private:
00076 struct PilotUser fUser;
00077 };
00078
00079 #endif
|