📄 record.h
字号:
#ifndef RECORD_H
#define RECORD_H
#include <string>
#include <fstream>
using namespace std;
class Record {
friend ostream& operator<<(ostream& os, const Record& rec);
public:
Record(string mRecId, string mEventType,
string mFacility, string mSeverity, int mEventTime,
string mFlags, string mThread, string mJobId, string mProcessor,
string mNode, string mBlock, string mEntryData, string mLocation);
Record(string mRecId, string mEventType,
string mFacility, string mSeverity, int mEventTime,
string mEntryData, string mLocation, string mJobId);
virtual ~Record() {};
bool operator<(const Record& anotherRecord) const;
string getRecId() const;
string getEventType() const;
string getFacility() const;
string getSeverity() const;
int getEventTime() const;
string getFlags() const;
string getThread() const;
string getJobId() const;
string getProcessor() const;
string getNode() const;
string getBlock() const;
string getEntryData() const;
string getLocation() const;
string getCategory() const;
Record(){};
//string getSize() const;
//string getFormat() const;
//string getSerialNumber() const;
private:
string mRecId;
string mEventType;
string mFacility;
string mSeverity;
int mEventTime;
string mFlags;
string mThread;
string mJobId;
string mProcessor;
string mNode;
string mBlock;
string mEntryData;
string mLocation;
//string mSize;
//string mFormat;
//string mSerialNumber;
};
inline ostream& operator<<(ostream& os, const Record& rec) {
//os << "Id: " << rec.getRecId();
//os << " Severity: " << rec.getSeverity();
//os << " Time: " << rec.getEventTime();
//os << " Facility: " << rec.getFacility();
os << rec.getRecId() << " " << rec.getSeverity() << " " << rec.getEventTime() << " " << rec.getFacility();
//os << rec.getRecId() << "\t" << rec.getEventType() << "\t" << rec.getFacility();
//os << "\t" << rec.getSeverity() << "\t" << rec.getEventTime() << "\t" << rec.getJobId();
//os << "\t" << rec.getNode() << "\t" << rec.getLocation() << "\t" << rec.getEntryData();
return os;
};
#endif /* RECORD_H */
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -