📄 linebuf.h
字号:
// LineBuf.h: interface for the LineBuf class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_LINEBUF_H__CAE1DDAF_1C66_407A_8659_F7079AB28FCA__INCLUDED_)
#define AFX_LINEBUF_H__CAE1DDAF_1C66_407A_8659_F7079AB28FCA__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <string>
using namespace std;
#include <stdio.h>
#include "Windows.h"
typedef struct _THREAD_INFO
{
LARGE_INTEGER CreateTime;
DWORD dwUnknown1;
DWORD dwStartAddress;
DWORD StartEIP;
DWORD dwOwnerPID;
DWORD dwThreadId;
DWORD dwCurrentPriority;
DWORD dwBasePriority;
DWORD dwContextSwitches;
DWORD Unknown;
DWORD WaitReason;
}THREADINFO, *PTHREADINFO;
typedef struct _UNICODE_STRING
{
USHORT Length;
USHORT MaxLength;
PWSTR Buffer;
} UNICODE_STRING;
typedef struct _PROCESS_INFO
{
DWORD dwOffset;
DWORD dwThreadsCount;
DWORD dwUnused1[6];
LARGE_INTEGER CreateTime;
LARGE_INTEGER UserTime;
LARGE_INTEGER KernelTime;
UNICODE_STRING ProcessName;
DWORD dwBasePriority;
DWORD dwProcessID;
DWORD dwParentProcessId;
DWORD dwHandleCount;
DWORD dwUnused3[2];
DWORD dwVirtualBytesPeak;
DWORD dwVirtualBytes;
ULONG dwPageFaults;
DWORD dwWorkingSetPeak;
DWORD dwWorkingSet;
DWORD dwQuotaPeakPagedPoolUsage;
DWORD dwQuotaPagedPoolUsage;
DWORD dwQuotaPeakNonPagedPoolUsage;
DWORD dwQuotaNonPagedPoolUsage;
DWORD dwPageFileUsage;
DWORD dwPageFileUsagePeak;
DWORD dCommitCharge;
THREADINFO ThreadSysInfo[1];
} PROCESSINFO, *PPROCESSINFO;
struct SysTime{
double m_ktime;
double m_utime;
DWORD m_vsize; //当前虚拟内存大小
SysTime(){
m_ktime = m_utime = 0.0;
m_vsize = 0;
}
/*
SysTime(SysTime& time){
this->m_ktime = time.m_ktime;
this->m_utime = time.m_utime;
this->m_vsize = time.m_vsize;
}
*/
};
class LineBuf
{
public:
SysTime GetTime(bool bUnitSecond);
void TimeTestEx();
SysTime GetTimeEx();
string GetBuf(const char* key, const char* paramlist, char sep = '=');
string GetBuf(int idx, const char* param, char sep = ' ');
string GetBuf(int idx, char sep = ' ');
SysTime GetTime();
void TimeTest();
void ReadLine(FILE* fp);
void SetSumFlag(bool bFlag){m_sumflag = bFlag;}
int GetBufInt(int idx, char sep = ' ');
int GetFieldSize();
LineBuf();
virtual ~LineBuf();
private:
string m_buf;
DWORD m_procid;
bool m_sumflag;
};
#endif // !defined(AFX_LINEBUF_H__CAE1DDAF_1C66_407A_8659_F7079AB28FCA__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -