~packet.~cpp

来自「基于JSP的网络聊天室系统,功能明了易懂」· ~CPP 代码 · 共 48 行

~CPP
48
字号
// Packet.cpp: implementation of the CPacket class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "ChatClient.h"
#include "Packet.h"

#ifdef _DEBUG
#undef THIS_FILE
static char THIS_FILE[]=__FILE__;
#define new DEBUG_NEW
#endif

//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CPacket::CPacket()
{

}

CPacket::~CPacket()
{

}

CString CPacket::GetNextCon(CString& pac, char mark)
{
   CString res="";
   int len = pac.Find(mark,0);
   if(len>=0)
   {
	   for(int i=0;i<len;i++)
	   {
		   res.Insert(i,pac[i]);
	   }
	   pac.Delete(0,len+1);
   }
   else
   {
	   res=pac;
	   pac="";
   }
   return res;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?