Changeset 148 for Mulberry/branches/v4.1d1/Sources_Common/HTTP/CardDAVClient/CCardDAVQueryReport.cpp
- Timestamp:
- 01/02/08 00:03:39 (1 year ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
Mulberry/branches/v4.1d1/Sources_Common/HTTP/CardDAVClient/CCardDAVQueryReport.cpp
r86 r148 34 34 using namespace carddav; 35 35 36 CCardDAVQueryReport::CCardDAVQueryReport(CWebDAVSession* session, const cdstring& ruri, const cdstring& search_prop, const cdstring& search_text ) :36 CCardDAVQueryReport::CCardDAVQueryReport(CWebDAVSession* session, const cdstring& ruri, const cdstring& search_prop, const cdstring& search_text, const cdstring& match_type) : 37 37 CWebDAVReport(session, ruri) 38 38 { 39 InitRequestData(search_prop, search_text );39 InitRequestData(search_prop, search_text, match_type); 40 40 } 41 41 … … 46 46 47 47 48 void CCardDAVQueryReport::InitRequestData(const cdstring& search_prop, const cdstring& search_text )48 void CCardDAVQueryReport::InitRequestData(const cdstring& search_prop, 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 );52 GenerateXML(os, search_prop, search_text, match_type); 53 53 os << ends; 54 54 … … 56 56 } 57 57 58 void CCardDAVQueryReport::GenerateXML(std::ostream& os, const cdstring& search_prop, const cdstring& search_text )58 void CCardDAVQueryReport::GenerateXML(std::ostream& os, const cdstring& search_prop, const cdstring& search_text, const cdstring& match_type) 59 59 { 60 60 using namespace xmllib; … … 65 65 // <DAV:prop> 66 66 // <DAV:getetag> 67 // <C:adbk-data/> 67 68 // </DAV:prop> 68 // <C:adbk-data/>69 69 // <C:filter> 70 // <C:comp-filter>71 70 // <C:prop-filter name="..."> 72 // <C:text-match caseless="yes">...</C:text-match>71 // <C:text-match match-type="...">...</C:text-match> 73 72 // </C:prop-filter> 74 // </C:comp-filter>75 73 // </C:filter> 76 74 // ... … … 94 92 new xmllib::XMLNode(&xmldoc, prop, cProperty_getetag.Name(), dav_namespc); 95 93 96 // <CardDAV:ad bk-data> element97 new xmllib::XMLNode(&xmldoc, query, cElement_adbkdata.Name(), carddav_namespc);94 // <CardDAV:addressbook-data> element 95 new xmllib::XMLNode(&xmldoc, prop, cElement_adbkdata.Name(), carddav_namespc); 98 96 99 97 // <CardDAV:filter> element 100 98 xmllib::XMLNode* filter = new xmllib::XMLNode(&xmldoc, query, cElement_filter.Name(), carddav_namespc); 101 99 102 // <CardDAV:comp-filter> element103 xmllib::XMLNode* comp_filter = new xmllib::XMLNode(&xmldoc, filter, cElement_compfilter.Name(), carddav_namespc);104 105 100 // <CardDAV:prop-filter name="..."> element 106 xmllib::XMLNode* prop_filter = new xmllib::XMLNode(&xmldoc, comp_filter, cElement_propfilter.Name(), carddav_namespc);101 xmllib::XMLNode* prop_filter = new xmllib::XMLNode(&xmldoc, filter, cElement_propfilter.Name(), carddav_namespc); 107 102 prop_filter->AddAttribute(cAttribute_name.Name(), search_prop); 108 103 109 // <C:text-match caseless="yes">...</C:text-match>104 // <C:text-match match-type="...">...</C:text-match> 110 105 xmllib::XMLNode* text_match = new xmllib::XMLNode(&xmldoc, prop_filter, cElement_textmatch.Name(), carddav_namespc, search_text); 111 text_match->AddAttribute(cAttribute_ caseless.Name(), cAttributeValue_yes.Name());106 text_match->AddAttribute(cAttribute_matchtype.Name(), match_type); 112 107 113 108 // Now we have the complete document, so write it out (no indentation)