#include "StdAfx.h"
|
#include "MBFireQrCodeSet.h"
|
|
|
CMBFireQrCodeSet::CMBFireQrCodeSet(void)
|
{
|
RemoveAllQrCode();
|
}
|
|
|
CMBFireQrCodeSet::~CMBFireQrCodeSet(void)
|
{
|
RemoveAllQrCode();
|
}
|
|
void CMBFireQrCodeSet::GetQrCodeVector( CMBFireQrCodeInfoVector &vectorQr)
|
{
|
vectorQr.clear();
|
vectorQr = m_vectorQr;
|
}
|
|
bool CMBFireQrCodeSet::AddQrCode( CMBFireQrCodeInfo *pQrCodeInfo )
|
{
|
if( NULL == pQrCodeInfo )
|
return false;
|
|
|
m_vectorQr.push_back(pQrCodeInfo);
|
|
return true;
|
}
|
|
bool CMBFireQrCodeSet::RemoveAllQrCode()
|
{
|
CMBFireQrCodeInfoVector::iterator it;
|
CMBFireQrCodeInfo *pQrCodeInfo = NULL;
|
|
for( it = m_vectorQr.begin();it != m_vectorQr.end();it++ )
|
{
|
pQrCodeInfo = *it;
|
delete pQrCodeInfo;
|
pQrCodeInfo = NULL;
|
}
|
|
m_vectorQr.clear();
|
|
return true;
|
}
|
|
|
CMBFireQrCodeInfo *CMBFireQrCodeSet::GetQrCode( int nDataType,CString strClsID,CString strAttr )
|
{
|
CMBFireQrCodeInfoVector::iterator it;
|
CMBFireQrCodeInfo *pQrCodeInfo = NULL;
|
|
for( it = m_vectorQr.begin();it != m_vectorQr.end();it++ )
|
{
|
pQrCodeInfo = *it;
|
if( pQrCodeInfo->m_nDataType == nDataType && pQrCodeInfo->m_strClsID == strClsID && pQrCodeInfo->m_strAttr == strAttr )
|
return pQrCodeInfo;
|
|
}
|
return NULL;
|
}
|
|
CString CMBFireQrCodeSet::GetQrCodeStr()
|
{
|
CString strQr;
|
CMBFireQrCodeInfoVector vectorQr;
|
CMBFireQrCodeInfoVector::iterator it;
|
CMBFireQrCodeInfo *pQrCodeInfo = NULL;
|
|
|
for( it = m_vectorQr.begin();it != m_vectorQr.end();it++ )
|
{
|
pQrCodeInfo = *it;
|
|
strQr += pQrCodeInfo->m_strTmpValue;
|
}
|
return strQr;
|
}
|