📄 clientserver.cpp
字号:
// client-server.cpp
#include "client-server.h"
#include <s32mem.h>
EXPORT_C CHerculesData* CHerculesData::NewLC(const TDesC8& aDes1, const TDesC8& aDes2, TInt aVal)
{
CHerculesData* data = new (ELeave)CHerculesData(aVal);
CleanupStack::PushL(data);
data->ConstructL(aDes1, aDes2);
return (data);
}
// Creates a CHerculesData initialized with the contents of the
// descriptor parameter
CHerculesData* CHerculesData::NewLC(const TDesC8& aStreamData)
{
CHerculesData* data = new (ELeave)CHerculesData();
CleanupStack::PushL(data);
// Open a read stream for the descriptor
RDesReadStream stream(aStreamData);
CleanupClosePushL(stream);
data->InternalizeL(stream);
CleanupStack::PopAndDestroy(&stream); // finished with the stream
return (data);
}
EXPORT_C CHerculesData::~CHerculesData()
{
delete iDes1;
delete iDes2;
}
CHerculesData::CHerculesData(TInt aVal)
: iVal(aVal){}
void CHerculesData::ConstructL(const TDesC8& aDes1, const TDesC8& aDes2)
{
iDes1 = aDes1.AllocL();
iDes2 = aDes2.AllocL();
}
// Creates and returns a heap descriptor which holds contents of 抰his
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -