📄 logfile.cpp
字号:
#include "StdAfx.h"
#include ".\logfile.h"
CLogFile::CLogFile( char* wndName )
{
char fileName[128] ;
sprintf( fileName , "%s" , wndName ) ;
m_pFile = fopen( fileName , "w+" ) ;
assert( m_pFile ) ;
}
CLogFile::~CLogFile()
{
FlushFile() ;
}
void CLogFile::AddStr( char* pStr )
{
int len = int(strlen( pStr )) ;
assert( len <= 1024 ) ;
string temp;
temp = pStr ;
m_lstStr.push_back( temp ) ;
}
void CLogFile::FlushFile()
{
list<string>::iterator iter = m_lstStr.begin() ;
while( iter != m_lstStr.end() )
{
fputs( (*iter).c_str() , m_pFile ) ;
fputs( "\n" , m_pFile ) ;
iter ++ ;
}
fclose( m_pFile ) ;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -