64 lines
1.2 KiB
C++
64 lines
1.2 KiB
C++
//-----------------------------------------------------------------------------+
|
|
// Copyright (C), 1998-2007, Beijing SH Software Co. Ltd.
|
|
// = FileName : TWValList.cpp
|
|
// = Version : ver2.0
|
|
// = Author :
|
|
// = CreateDate : 2002-09-09
|
|
// = Description: 类的定义
|
|
// = Maintainers:
|
|
//
|
|
//-----------------------------------------------------------------------------+
|
|
#include "..\StdAfx.h"
|
|
#include "EarThwormDef.h"
|
|
#include "TWValList.h"
|
|
|
|
TWValList::TWValList(const char *format,const TAString &s)
|
|
{
|
|
long cur = 0, sCur = 0;
|
|
while (format[cur] != NULL)
|
|
{
|
|
TWFormatUnit *pFU = new TWFormatUnit(format,cur,s,sCur);
|
|
if (pFU->IsValid())
|
|
{
|
|
AddTail(pFU);
|
|
}
|
|
else
|
|
{
|
|
DELETE_PTR(pFU);
|
|
}
|
|
}
|
|
}
|
|
|
|
TWValList::TWValList(const char *format,char *p)
|
|
{
|
|
long cur = 0;
|
|
char* curP = p + sizeof(char*);
|
|
while (format[cur] != NULL)
|
|
{
|
|
TWFormatUnit *pFU = new TWFormatUnit(format,cur,curP);
|
|
if (pFU->IsValid())
|
|
{
|
|
AddTail(pFU);
|
|
}
|
|
else
|
|
{
|
|
DELETE_PTR(pFU);
|
|
}
|
|
}
|
|
}
|
|
|
|
TWValList::~TWValList()
|
|
{
|
|
|
|
}
|
|
|
|
long TWValList::GetStringLength()
|
|
{
|
|
long l = 0;
|
|
for (MoveToFirst(); !IsOut(); MoveToNext())
|
|
{
|
|
l += GetCurData()->Length();
|
|
}
|
|
|
|
return l;
|
|
} |