DataParsing.cpp
上传用户:hnzycx
上传日期:2022-08-09
资源大小:12567k
文件大小:1k
- #include "StdAfx.h"
- #include "DataParsing.h"
- CDataParsing::CDataParsing(CString in)
- {
- cIn=in;
- }
- CDataParsing::~CDataParsing(void)
- {
- delete [] returnForDB;
- }
- void CDataParsing::ProcessDataForDB(CStringList &currUseStrList)
- {
- CString temp=cIn;
- CString current;
- CString inner;
- CString removeStr;
- int underlinePos;
- CStringList currUseStrList1;
- for(inner=temp;;inner.Replace(removeStr,_T("")))
- {
- underlinePos=inner.Find(_T("@"));
- if(underlinePos!=-1)
- {
- current=inner.Left(underlinePos);//@左边
- currUseStrList1.AddTail(current);
- removeStr=inner.Left(underlinePos+1);//@左边,含@
-
- }
- else
- {
- inner.Replace(_T("rn"),_T(""));
- currUseStrList1.AddTail(inner);
- break;
- }
- }
- POSITION pos=currUseStrList1.GetHeadPosition();
- CString metaData;
- //循环把每个元组数据取出
- while(pos)
- {
- //对每个元组数据进行处理
- metaData=currUseStrList1.GetNext(pos);
- for(inner=metaData;;inner.Replace(removeStr,_T("")))
- {
- underlinePos=inner.Find(_T("#"));
- if(underlinePos!=-1)
- {
- current=inner.Left(underlinePos);
- currUseStrList.AddTail(current);
- removeStr=inner.Left(underlinePos+1);
- }
- else
- {
- currUseStrList.AddTail(inner);
- break;
- }
- }
-
- }
- }