Changeset 149 for Mulberry/branches/v4.1d1/Sources_Common/HTTP/CardDAVClient/CCardDAVQueryReport.cpp
- Timestamp:
- 01/13/08 12:24:39 (11 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
Mulberry/branches/v4.1d1/Sources_Common/HTTP/CardDAVClient/CCardDAVQueryReport.cpp
r148 r149 34 34 using namespace carddav; 35 35 36 CCardDAVQueryReport::CCardDAVQueryReport(CWebDAVSession* session, const cdstring& ruri, const cdstr ing& search_prop, const cdstring& search_text, const cdstring& match_type) :36 CCardDAVQueryReport::CCardDAVQueryReport(CWebDAVSession* session, const cdstring& ruri, const cdstrvect& search_props, const cdstring& search_text, const cdstring& match_type) : 37 37 CWebDAVReport(session, ruri) 38 38 { 39 InitRequestData(search_prop , search_text, match_type);39 InitRequestData(search_props, search_text, match_type); 40 40 } 41 41 … … 46 46 47 47 48 void CCardDAVQueryReport::InitRequestData(const cdstr ing& search_prop, const cdstring& search_text, const cdstring& match_type)48 void CCardDAVQueryReport::InitRequestData(const cdstrvect& search_props, const cdstring& search_text, const cdstring& match_type) 49 49 { 50 50 // Write XML info to a string 51 51 std::ostrstream os; 52 GenerateXML(os, search_prop , search_text, match_type);52 GenerateXML(os, search_props, search_text, match_type); 53 53 os << ends; 54 54 … … 56 56 } 57 57 58 void CCardDAVQueryReport::GenerateXML(std::ostream& os, const cdstr ing& search_prop, const cdstring& search_text, const cdstring& match_type)58 void CCardDAVQueryReport::GenerateXML(std::ostream& os, const cdstrvect& search_props, const cdstring& search_text, const cdstring& match_type) 59 59 { 60 60 using namespace xmllib; … … 71 71 // <C:text-match match-type="...">...</C:text-match> 72 72 // </C:prop-filter> 73 // ... 73 74 // </C:filter> 74 75 // ... … … 98 99 xmllib::XMLNode* filter = new xmllib::XMLNode(&xmldoc, query, cElement_filter.Name(), carddav_namespc); 99 100 100 // <CardDAV:prop-filter name="..."> element 101 xmllib::XMLNode* prop_filter = new xmllib::XMLNode(&xmldoc, filter, cElement_propfilter.Name(), carddav_namespc); 102 prop_filter->AddAttribute(cAttribute_name.Name(), search_prop); 101 for(cdstrvect::const_iterator iter = search_props.begin(); iter != search_props.end(); iter++) 102 { 103 // <CardDAV:prop-filter name="..."> element 104 xmllib::XMLNode* prop_filter = new xmllib::XMLNode(&xmldoc, filter, cElement_propfilter.Name(), carddav_namespc); 105 prop_filter->AddAttribute(cAttribute_name.Name(), *iter); 103 106 104 // <C:text-match match-type="...">...</C:text-match> 105 xmllib::XMLNode* text_match = new xmllib::XMLNode(&xmldoc, prop_filter, cElement_textmatch.Name(), carddav_namespc, search_text); 106 text_match->AddAttribute(cAttribute_matchtype.Name(), match_type); 107 // <C:text-match match-type="...">...</C:text-match> 108 xmllib::XMLNode* text_match = new xmllib::XMLNode(&xmldoc, prop_filter, cElement_textmatch.Name(), carddav_namespc, search_text); 109 text_match->AddAttribute(cAttribute_matchtype.Name(), match_type); 110 } 107 111 108 112 // Now we have the complete document, so write it out (no indentation)