468 lines
8.4 KiB
C++
468 lines
8.4 KiB
C++
// Version: 2019.4.4 10:22:45
|
|
|
|
#ifndef _T_LOG_INFO_H
|
|
#define _T_LOG_INFO_H
|
|
#include <stdio.h>
|
|
#include <string.h>
|
|
#include <stdlib.h>
|
|
#ifdef _MSC_VER
|
|
#pragma warning(disable:4996)
|
|
#pragma warning(disable:4267)
|
|
#endif
|
|
#include "T_LOG_INFODBAX.h"
|
|
class T_LOG_INFO{
|
|
friend class T_LOG_INFODBAX;
|
|
private:
|
|
//aggregation to DB Class
|
|
T_LOG_INFODBAX db;
|
|
public:
|
|
//
|
|
//A T T R I B U T E S
|
|
//===================
|
|
//
|
|
bool dbAccess;
|
|
char* dbMessage;// pointer for the return values of DBAX methodes
|
|
char messageBuffer[200];// temporary message buffer
|
|
friend class PapLib;
|
|
protected:
|
|
//
|
|
//A T T R I B U T E S
|
|
//===================
|
|
//
|
|
long l_SeqNo;
|
|
char c_extId[20+1];
|
|
short s_extIdZi;
|
|
char c_HostName[30+1];
|
|
short s_HostNameZi;
|
|
char c_Information[255+1];
|
|
short s_InformationZi;
|
|
char c_IPADDR[30+1];
|
|
short s_IPADDRZi;
|
|
long l_LogLevel;
|
|
short s_LogLevelZi;
|
|
char c_LogTime[27];
|
|
short s_LogTimeZi;
|
|
char c_Module[50+1];
|
|
short s_ModuleZi;
|
|
char c_UserID[25+1];
|
|
short s_UserIDZi;
|
|
char c_toc[27];
|
|
short s_tocZi;
|
|
char c_tom[27];
|
|
short s_tomZi;
|
|
char c_mop[121];
|
|
short s_mopZi;
|
|
char c_mou[31];
|
|
short s_mouZi;
|
|
// arguments for Primary key
|
|
long l_k_SeqNo;
|
|
public:
|
|
//
|
|
// LTA Structure
|
|
struct STR_T_LOG_INFO{
|
|
int SeqNo;
|
|
char extId[20+1];
|
|
char HostName[30+1];
|
|
char Information[255+1];
|
|
char IPADDR[30+1];
|
|
int LogLevel;
|
|
char LogTime[27];
|
|
char Module[50+1];
|
|
char UserID[25+1];
|
|
char toc[27];
|
|
char tom[27];
|
|
char mop[121];
|
|
char mou[31];
|
|
}structTable;
|
|
// LTA Structure Zi
|
|
struct STR_T_LOG_INFOZi{
|
|
short extIdZi;
|
|
short HostNameZi;
|
|
short InformationZi;
|
|
short IPADDRZi;
|
|
short LogLevelZi;
|
|
short LogTimeZi;
|
|
short ModuleZi;
|
|
short UserIDZi;
|
|
short tocZi;
|
|
short tomZi;
|
|
short mopZi;
|
|
short mouZi;
|
|
}structTableZi;
|
|
//
|
|
//C O N S T R U C T O R S
|
|
//=======================
|
|
//
|
|
public:
|
|
T_LOG_INFO();
|
|
//D E S T R U C T O R S
|
|
//=======================
|
|
//
|
|
virtual ~T_LOG_INFO();
|
|
//
|
|
//C O P Y - C O N S T R U C T O R
|
|
//=======================
|
|
T_LOG_INFO(const T_LOG_INFO &inst);
|
|
// For Constructors with parameters the flag dbAccess
|
|
// informs you if the access was successfully or not
|
|
T_LOG_INFO( long arg1);
|
|
|
|
//methods
|
|
public:
|
|
char* getCreationTime() {return (char*)"2019.4.4 10:22:45";};
|
|
//initial data
|
|
void initial();
|
|
//read data
|
|
char* readDB();
|
|
//update data
|
|
char* updateDB();
|
|
//insert data
|
|
char* insertDB();
|
|
//this methode tries to update a DB record , when the update fails , the methode
|
|
//tries an insert of the failed record
|
|
char* storeDB();
|
|
//delete data
|
|
char* deleteDB();
|
|
//delete data
|
|
char* deleteDB(const char* where , long* count );
|
|
//openSetDB data
|
|
char* openSetDB(const char* where ,const char* order );
|
|
//getSetDB data
|
|
char* getSetDB();
|
|
//closeSetDB data
|
|
char* closeSetDB();
|
|
//countDB data
|
|
char* countDB(const char* where , long* count );
|
|
|
|
char* execute(const char* sql , long* count );
|
|
|
|
char* dbCommit();
|
|
|
|
char* dbRollback();
|
|
public:
|
|
//
|
|
// public methode setPrimKey
|
|
//
|
|
// this methode stores the unique key attributes
|
|
//
|
|
void setPrimKey(long arg1 );
|
|
|
|
|
|
// public methode initInsertKeys
|
|
//
|
|
// this methode stores the unique key attributes
|
|
//
|
|
void initInsertKeys( long arg1 );
|
|
|
|
|
|
public:
|
|
//
|
|
// public methode setKeysFromRecord
|
|
//
|
|
// this methode set the unique key attributes from the DB Record Attributes
|
|
//
|
|
void setKeysFromRecord();
|
|
|
|
//
|
|
//O P E R A T O R +
|
|
//===================
|
|
//
|
|
public:
|
|
T_LOG_INFO operator+(const T_LOG_INFO &inst) const;
|
|
|
|
//
|
|
//O P E R A T O R =
|
|
//===================
|
|
//
|
|
public:
|
|
const T_LOG_INFO& operator=(const T_LOG_INFO &inst);
|
|
long SeqNo() const;//{
|
|
//return((long)l_SeqNo );
|
|
//}
|
|
|
|
|
|
void set_SeqNo( long arg );//{
|
|
//l_SeqNo = arg;
|
|
//return;
|
|
//}
|
|
|
|
|
|
char* extId() const;//{
|
|
//return((char*)c_extId );
|
|
//}
|
|
|
|
short extIdZi() const;//{
|
|
//return( s_extIdZi);
|
|
//}
|
|
|
|
void set_extId( const char* arg );//{
|
|
//strncpy((char*)c_extId , arg , sizeof(c_extId));
|
|
//c_extId[sizeof(c_extId)-1] = '\0';
|
|
//s_extIdZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_extIdZi( short arg ) ;//{
|
|
//s_extIdZi = arg;
|
|
//}
|
|
|
|
char* HostName() const;//{
|
|
//return((char*)c_HostName );
|
|
//}
|
|
|
|
short HostNameZi() const;//{
|
|
//return( s_HostNameZi);
|
|
//}
|
|
|
|
void set_HostName( const char* arg );//{
|
|
//strncpy((char*)c_HostName , arg , sizeof(c_HostName));
|
|
//c_HostName[sizeof(c_HostName)-1] = '\0';
|
|
//s_HostNameZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_HostNameZi( short arg ) ;//{
|
|
//s_HostNameZi = arg;
|
|
//}
|
|
|
|
char* Information() const;//{
|
|
//return((char*)c_Information );
|
|
//}
|
|
|
|
short InformationZi() const;//{
|
|
//return( s_InformationZi);
|
|
//}
|
|
|
|
void set_Information( const char* arg );//{
|
|
//strncpy((char*)c_Information , arg , sizeof(c_Information));
|
|
//c_Information[sizeof(c_Information)-1] = '\0';
|
|
//s_InformationZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_InformationZi( short arg ) ;//{
|
|
//s_InformationZi = arg;
|
|
//}
|
|
|
|
char* IPADDR() const;//{
|
|
//return((char*)c_IPADDR );
|
|
//}
|
|
|
|
short IPADDRZi() const;//{
|
|
//return( s_IPADDRZi);
|
|
//}
|
|
|
|
void set_IPADDR( const char* arg );//{
|
|
//strncpy((char*)c_IPADDR , arg , sizeof(c_IPADDR));
|
|
//c_IPADDR[sizeof(c_IPADDR)-1] = '\0';
|
|
//s_IPADDRZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_IPADDRZi( short arg ) ;//{
|
|
//s_IPADDRZi = arg;
|
|
//}
|
|
|
|
long LogLevel() const;//{
|
|
//return((long)l_LogLevel );
|
|
//}
|
|
|
|
short LogLevelZi() const;//{
|
|
//return( s_LogLevelZi);
|
|
//}
|
|
|
|
void set_LogLevel( long arg );//{
|
|
//l_LogLevel = arg;
|
|
//s_LogLevelZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_LogLevelZi( short arg ) ;//{
|
|
//s_LogLevelZi = arg;
|
|
//}
|
|
|
|
char* LogTime() const;//{
|
|
//return((char*)c_LogTime );
|
|
//}
|
|
|
|
short LogTimeZi() const;//{
|
|
//return( s_LogTimeZi);
|
|
//}
|
|
|
|
void set_LogTime( char* arg );//{
|
|
//strncpy((char*)c_LogTime , arg , sizeof(c_LogTime));
|
|
//c_LogTime[sizeof(c_LogTime)-1] = '\0';
|
|
//s_LogTimeZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_LogTimeZi( short arg ) ;//{
|
|
//s_LogTimeZi = arg;
|
|
//}
|
|
|
|
char* Module() const;//{
|
|
//return((char*)c_Module );
|
|
//}
|
|
|
|
short ModuleZi() const;//{
|
|
//return( s_ModuleZi);
|
|
//}
|
|
|
|
void set_Module( const char* arg );//{
|
|
//strncpy((char*)c_Module , arg , sizeof(c_Module));
|
|
//c_Module[sizeof(c_Module)-1] = '\0';
|
|
//s_ModuleZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_ModuleZi( short arg ) ;//{
|
|
//s_ModuleZi = arg;
|
|
//}
|
|
|
|
char* UserID() const;//{
|
|
//return((char*)c_UserID );
|
|
//}
|
|
|
|
short UserIDZi() const;//{
|
|
//return( s_UserIDZi);
|
|
//}
|
|
|
|
void set_UserID( const char* arg );//{
|
|
//strncpy((char*)c_UserID , arg , sizeof(c_UserID));
|
|
//c_UserID[sizeof(c_UserID)-1] = '\0';
|
|
//s_UserIDZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_UserIDZi( short arg ) ;//{
|
|
//s_UserIDZi = arg;
|
|
//}
|
|
|
|
public:
|
|
char* toc() const;//{
|
|
//return((char*)c_toc );
|
|
//}
|
|
|
|
short tocZi() const;//{
|
|
//return( s_tocZi);
|
|
//}
|
|
|
|
protected:
|
|
void set_toc( char* arg );//{
|
|
//strncpy((char*)c_toc , arg , sizeof(c_toc));
|
|
//c_toc[sizeof(c_toc)-1] = '\0';
|
|
//s_tocZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_tocZi( short arg );//{
|
|
//s_tocZi = arg;
|
|
//}
|
|
|
|
public:
|
|
char* tom() const;//{
|
|
//return((char*)c_tom );
|
|
//}
|
|
|
|
short tomZi() const;//{
|
|
//return( s_tomZi);
|
|
//}
|
|
|
|
protected:
|
|
void set_tom( char* arg );//{
|
|
//strncpy((char*)c_tom , arg , sizeof(c_tom));
|
|
//c_tom[sizeof(c_tom)-1] = '\0';
|
|
//s_tomZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_tomZi( short arg );//{
|
|
//s_tomZi = arg;
|
|
//}
|
|
|
|
public:
|
|
char* mop() const;//{
|
|
//return((char*)c_mop );
|
|
//}
|
|
|
|
short mopZi() const;//{
|
|
//return( s_mopZi);
|
|
//}
|
|
|
|
protected:
|
|
void set_mop( char* arg );//{
|
|
//strncpy((char*)c_mop , arg , sizeof(c_mop));
|
|
//c_mop[sizeof(c_mop)-1] = '\0';
|
|
//s_mopZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_mopZi( short arg );//{
|
|
//s_mopZi = arg;
|
|
//}
|
|
|
|
public:
|
|
char* mou() const;//{
|
|
//return((char*)c_mou );
|
|
//}
|
|
|
|
short mouZi() const;//{
|
|
//return( s_mouZi);
|
|
//}
|
|
|
|
protected:
|
|
void set_mou( char* arg );//{
|
|
//strncpy((char*)c_mou , arg , sizeof(c_mou));
|
|
//c_mou[sizeof(c_mou)-1] = '\0';
|
|
//s_mouZi= 0;
|
|
//return;
|
|
//}
|
|
|
|
void set_mouZi( short arg );//{
|
|
//s_mouZi = arg;
|
|
//}
|
|
|
|
public:
|
|
// methodes for Primary key
|
|
long k_SeqNo();//{
|
|
//return((long)l_k_SeqNo );
|
|
//}
|
|
|
|
void set_k_SeqNo( long arg );//{
|
|
//l_k_SeqNo = arg;
|
|
//return;
|
|
//}
|
|
|
|
public:
|
|
//
|
|
// public methode fillStructure
|
|
//
|
|
// this methode filles the classstructue with the private attributes
|
|
//
|
|
void fillStructure();//{
|
|
//}
|
|
///////////////////////////////////////////////////
|
|
void fillStructureZi();//{
|
|
//}
|
|
///////////////////////////////////////////////////
|
|
void setStructure();// {
|
|
//return;
|
|
//}
|
|
///////////////////////////////////////////////////
|
|
void setStructureZi() ;//{
|
|
//}
|
|
///////////////////////////////////////////////////
|
|
char* getName();//{
|
|
//return((char*)"T_LOG_INFO");
|
|
//}
|
|
///////////////////////////////////////////////////
|
|
int getSqlCode();//{
|
|
//return( db.dbSqlCode);
|
|
//}
|
|
///////////////////////////////////////////////////
|
|
int getRowsProcessed();//{
|
|
//return( db.dbRowsProcessed);
|
|
//}
|
|
};
|
|
#endif
|