Show
Ignore:
Timestamp:
01/02/08 00:03:39 (1 year ago)
Author:
daboo
Message:

Lots of CardDAV stuff.

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • Mulberry/branches/v4.1d1/Sources_Common/HTTP/CardDAVClient/CCardDAVQueryReport.cpp

    r86 r148  
    3434using namespace carddav;  
    3535 
    36 CCardDAVQueryReport::CCardDAVQueryReport(CWebDAVSession* session, const cdstring& ruri, const cdstring& search_prop, const cdstring& search_text) : 
     36CCardDAVQueryReport::CCardDAVQueryReport(CWebDAVSession* session, const cdstring& ruri, const cdstring& search_prop, const cdstring& search_text, const cdstring& match_type) : 
    3737        CWebDAVReport(session, ruri) 
    3838{ 
    39         InitRequestData(search_prop, search_text); 
     39        InitRequestData(search_prop, search_text, match_type); 
    4040} 
    4141 
     
    4646 
    4747 
    48 void CCardDAVQueryReport::InitRequestData(const cdstring& search_prop, const cdstring& search_text) 
     48void CCardDAVQueryReport::InitRequestData(const cdstring& search_prop, const cdstring& search_text, const cdstring& match_type) 
    4949{ 
    5050        // Write XML info to a string 
    5151        std::ostrstream os; 
    52         GenerateXML(os, search_prop, search_text); 
     52        GenerateXML(os, search_prop, search_text, match_type); 
    5353        os << ends; 
    5454         
     
    5656} 
    5757 
    58 void CCardDAVQueryReport::GenerateXML(std::ostream& os, const cdstring& search_prop, const cdstring& search_text) 
     58void CCardDAVQueryReport::GenerateXML(std::ostream& os, const cdstring& search_prop, const cdstring& search_text, const cdstring& match_type) 
    5959{ 
    6060        using namespace xmllib; 
     
    6565        //   <DAV:prop> 
    6666        //     <DAV:getetag> 
     67        //     <C:adbk-data/> 
    6768        //   </DAV:prop> 
    68         //   <C:adbk-data/> 
    6969        //       <C:filter> 
    70         //       <C:comp-filter> 
    7170        //         <C:prop-filter name="..."> 
    72         //           <C:text-match caseless="yes">...</C:text-match> 
     71        //           <C:text-match match-type="...">...</C:text-match> 
    7372        //         </C:prop-filter> 
    74         //       </C:comp-filter> 
    7573        //       </C:filter> 
    7674        //   ... 
     
    9492        new xmllib::XMLNode(&xmldoc, prop, cProperty_getetag.Name(), dav_namespc); 
    9593         
    96         // <CardDAV:adbk-data> element 
    97         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); 
    9896         
    9997        // <CardDAV:filter> element 
    10098        xmllib::XMLNode* filter = new xmllib::XMLNode(&xmldoc, query, cElement_filter.Name(), carddav_namespc); 
    10199         
    102         // <CardDAV:comp-filter> element 
    103         xmllib::XMLNode* comp_filter = new xmllib::XMLNode(&xmldoc, filter, cElement_compfilter.Name(), carddav_namespc); 
    104          
    105100        // <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); 
    107102        prop_filter->AddAttribute(cAttribute_name.Name(), search_prop); 
    108103 
    109         // <C:text-match caseless="yes">...</C:text-match> 
     104        // <C:text-match match-type="...">...</C:text-match> 
    110105        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); 
    112107 
    113108        // Now we have the complete document, so write it out (no indentation)