#include "StdAfx.h" #include "RcpZoneInfo.h" CRcpZoneInfo::CRcpZoneInfo(int nType) { Reset(nType); } CRcpZoneInfo::CRcpZoneInfo(void) { } CRcpZoneInfo::~CRcpZoneInfo(void) { } void CRcpZoneInfo::Reset(int nType) { m_nZoneType = nType; m_strZoneString = _T(""); m_vecZoneString.clear(); m_vecZoneNumber.clear(); } void CRcpZoneInfo::SetInfo(const CRcpZoneInfo& rhs) { *this = rhs; } void CRcpZoneInfo::GetInfo(CRcpZoneInfo& rhs) { rhs = *this; } void CRcpZoneInfo::SetZoneString(const CString& strString) { m_strZoneString.Format(_T("%s"), strString); SetZoneVecString(); } void CRcpZoneInfo::SetZoneVecString() { if (m_strZoneString.GetLength()<=0) return; CString strData=_T(""), strZone=_T(""); m_vecZoneString.clear(); m_vecZoneNumber.clear(); strData = m_strZoneString; int nIdx = 0, nCount = 0, nCount2=0; while(TRUE) { nIdx = strData.Find(_T(','), nIdx + 1); if(nIdx != -1) nCount++; else break; } if (nCount<=0) { m_vecZoneString.push_back(strData); m_vecZoneNumber.push_back(GetZoneNumber(strData)); } else { char strLine[128] = {0, }; char *strTemp, *strTemp2; char *strType; USES_CONVERSION; sprintf_s(strLine, "%s", strData); for (int nIdx=0; nIdx