47 lines
983 B
C++
47 lines
983 B
C++
//-----------------------------------------------------------------------------+
|
|
// Copyright (C), 1998-2007, Beijing Tangent Software Co. Ltd.
|
|
// = FileName : TWDictPath 类
|
|
// = Version : ver2.0
|
|
// = Author : wlw
|
|
// = CreateDate : 2002-09-09
|
|
// = Description: TWDictPath 定义
|
|
// = Maintainers:
|
|
//
|
|
//-----------------------------------------------------------------------------+
|
|
#include "StdAfx.h"
|
|
#include "TWDictPath.h"
|
|
#include "TWDict.h"
|
|
|
|
TWDictPath::~TWDictPath()
|
|
{
|
|
|
|
}
|
|
|
|
TWDictPath::TWDictPath(const CString&sPath)
|
|
{
|
|
for (int iFrom = 0,iTo = -1; (iTo = sPath.Find(_T('\\'),iFrom)) != -1; iFrom = iTo + 1)
|
|
{
|
|
AddTail(new TWDict(sPath.Mid(iFrom,iTo - iFrom)));
|
|
}
|
|
|
|
AddTail(new TWDictItem(sPath.Right(sPath.GetLength() - iFrom)));//最后一层
|
|
}
|
|
|
|
bool TWDictPath::IsValid()
|
|
{
|
|
if (IsEmpty())
|
|
{
|
|
return false;
|
|
}
|
|
|
|
for (MoveToFirst(); !IsOut(); MoveToNext())
|
|
{
|
|
if (!GetCurData()->IsValid())
|
|
{
|
|
return false;
|
|
}
|
|
}
|
|
|
|
return true;
|
|
}
|