DwDispositionType::~DwDispositionType() { if(mFirstParameter) { DeleteParameterList(); } }
void CParameterInfo::Serialize(CArchive& ar) { std::list<CParameter*>::iterator pos; std::list<CReturnParameter*>::iterator pos1; CParameter* pParameter; CReturnParameter* pReturnParameter; size_t count; if(ar.IsStoring()) { //Parameter List count = m_ParameterList.size(); ar << count; for(pos = m_ParameterList.begin(); pos != m_ParameterList.end(); pos++) { pParameter = *pos; pParameter->Serialize(ar); } //ReturnParameter List count = m_ReturnParameterList.size(); ar << count; for(pos1 = m_ReturnParameterList.begin(); pos1 != m_ReturnParameterList.end(); pos1++) { pReturnParameter = *pos1; pReturnParameter->Serialize(ar); } } else { //Parameter List DeleteParameterList(); ar >> count; for(int i=0;i<count;i++) { pParameter = new CParameter(); pParameter->Serialize(ar); m_ParameterList.push_back(pParameter); } //ReturnParameter List DeleteReturnParameterList(); ar >> count; for(int i=0;i<count;i++) { pReturnParameter = new CReturnParameter(); pReturnParameter->Serialize(ar); m_ReturnParameterList.push_back(pReturnParameter); } } }
const DwDispositionType &DwDispositionType::operator = ( const DwDispositionType &aDispType) { if(this == &aDispType) return *this; mDispositionType = aDispType.mDispositionType; mDispositionTypeStr = aDispType.mDispositionTypeStr; mFilenameStr = aDispType.mFilenameStr; if(mFirstParameter) { DeleteParameterList(); } if(aDispType.mFirstParameter) { CopyParameterList(aDispType.mFirstParameter); } if(mParent) { mParent->SetModified(); } return *this; }
void CParameterInfo::Reset() { DeleteParameterList(); DeleteReturnParameterList(); }
void DwDispositionType::Parse() { mIsModified = 0; mDispositionType = DwMime::kDispTypeNull; mDispositionTypeStr = ""; if(mFirstParameter) { DeleteParameterList(); } if(mString.length() == 0) return; DwRfc1521Tokenizer tokenizer(mString); int found = 0; while(!found && tokenizer.Type() != eTkNull) { if(tokenizer.Type() == eTkToken) { mDispositionTypeStr = tokenizer.Token(); found = 1; } ++tokenizer; } // Get parameters DwTokenString tokenStr(mString); while(1) { // Get ';' found = 0; while(!found && tokenizer.Type() != eTkNull) { if(tokenizer.Type() == eTkTspecial && tokenizer.Token()[0] == ';') { found = 1; } ++tokenizer; } if(tokenizer.Type() == eTkNull) { // No more parameters break; } tokenStr.SetFirst(tokenizer); // Get attribute DwString attrib; int attribFound = 0; while(!attribFound && tokenizer.Type() != eTkNull) { if(tokenizer.Type() == eTkToken) { attrib = tokenizer.Token(); attribFound = 1; } ++tokenizer; } // Get '=' found = 0; while(!found && tokenizer.Type() != eTkNull) { if(tokenizer.Type() == eTkTspecial && tokenizer.Token()[0] == '=') { found = 1; } ++tokenizer; } // Get value int valueFound = 0; while(!valueFound && tokenizer.Type() != eTkNull) { if(tokenizer.Type() == eTkToken || tokenizer.Type() == eTkQuotedString) { valueFound = 1; } ++tokenizer; } if(attribFound && valueFound) { tokenStr.ExtendTo(tokenizer); DwParameter *param = DwParameter::NewParameter(tokenStr.Tokens(), this); param->Parse(); _AddParameter(param); } } StrToEnum(); }