?? queue.cpp
字號(hào):
// Queue.cpp: implementation of the Queue class.
//
//////////////////////////////////////////////////////////////////////
#include "stdafx.h"
#include "MirrorGuide.h"
#include "Queue.h"
#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif
//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////
Queue::Queue()
{
pQueue = NULL;
putIndex = getIndex = 0;
}
Queue::~Queue()
{
if ( pQueue != NULL )
_rmtmp ();
}
BOOL Queue::IsEmpty()
{
if ( pQueue == NULL || getIndex == putIndex )
return TRUE;
return FALSE;
}
BOOL Queue::InQueue ( CString string )
{
if ( pQueue == NULL )
if ( (pQueue = tmpfile()) == NULL )
{
AfxMessageBox ( "Please Email to default@etang.com, error occurs!", NULL, MB_OK );
exit ( 0 );
}
fseek ( pQueue, 0, 2 );
fputs ( string, pQueue );
fputs ( "\r\n", pQueue );
fflush ( pQueue );
putIndex ++;
return TRUE;
}
BOOL Queue::GetHead ( CString &string )
{
if ( pQueue != NULL && !IsEmpty() )
{
rewind ( pQueue );
char buf[1024];
for ( int i = 0; i <= getIndex; i ++ )
fgets ( buf, 1024, pQueue );
getIndex ++;
string.Format ( "%s", buf );
string.Delete ( string.GetLength() - 2, 2 );
return TRUE;
}
return FALSE;
}
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -