DAVProperties.cxx (59ddfc10) | DAVProperties.cxx (06594b87) |
---|---|
1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 12 unchanged lines hidden (view full) --- 21 22 23 24// MARKER(update_precomp.py): autogen include statement, do not remove 25#include "precompiled_ucb.hxx" 26 27#include <string.h> 28#include "DAVProperties.hxx" | 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 12 unchanged lines hidden (view full) --- 21 22 23 24// MARKER(update_precomp.py): autogen include statement, do not remove 25#include "precompiled_ucb.hxx" 26 27#include <string.h> 28#include "DAVProperties.hxx" |
29#include <rtl/ustrbuf.hxx> |
|
29 30using namespace http_dav_ucp; 31 32const ::rtl::OUString DAVProperties::CREATIONDATE = 33 ::rtl::OUString::createFromAscii( "DAV:creationdate" ); 34const ::rtl::OUString DAVProperties::DISPLAYNAME = 35 ::rtl::OUString::createFromAscii( "DAV:displayname" ); 36const ::rtl::OUString DAVProperties::GETCONTENTLANGUAGE = --- 150 unchanged lines hidden (view full) --- 187// static 188bool DAVProperties::isUCBDeadProperty( const SerfPropName & rName ) 189{ 190 return ( rName.nspace && 191 ( rtl_str_compareIgnoreAsciiCase( 192 rName.nspace, "http://ucb.openoffice.org/dav/props/" ) 193 == 0 ) ); 194} | 30 31using namespace http_dav_ucp; 32 33const ::rtl::OUString DAVProperties::CREATIONDATE = 34 ::rtl::OUString::createFromAscii( "DAV:creationdate" ); 35const ::rtl::OUString DAVProperties::DISPLAYNAME = 36 ::rtl::OUString::createFromAscii( "DAV:displayname" ); 37const ::rtl::OUString DAVProperties::GETCONTENTLANGUAGE = --- 150 unchanged lines hidden (view full) --- 188// static 189bool DAVProperties::isUCBDeadProperty( const SerfPropName & rName ) 190{ 191 return ( rName.nspace && 192 ( rtl_str_compareIgnoreAsciiCase( 193 rName.nspace, "http://ucb.openoffice.org/dav/props/" ) 194 == 0 ) ); 195} |
196 197bool DAVProperties::isUCBSpecialProperty(const rtl::OUString& rFullName, rtl::OUString& rParsedName) 198{ 199 sal_Int32 nLen = rFullName.getLength(); 200 if ( nLen <= 0 || 201 !rFullName.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "<prop:" ) ) || 202 !rFullName.endsWithAsciiL( RTL_CONSTASCII_STRINGPARAM( "\">" ) ) ) 203 return false; 204 205 sal_Int32 nStart = RTL_CONSTASCII_LENGTH( "<prop:" ); 206 sal_Int32 nEnd = rFullName.indexOf( sal_Unicode( ' ' ), nStart ); 207 if ( nEnd == -1 ) 208 return false; 209 210 rtl::OUString sPropName = rFullName.copy( nStart, nEnd - nStart ); 211 if ( !sPropName.getLength() ) 212 return false; 213 214 // TODO skip whitespaces? 215 if ( !rFullName.matchAsciiL( RTL_CONSTASCII_STRINGPARAM( "xmlns:prop=\"" ), ++nEnd ) ) 216 return false; 217 218 nStart = nEnd + RTL_CONSTASCII_LENGTH( "xmlns:prop=\"" ); 219 nEnd = rFullName.indexOf( sal_Unicode( '"' ), nStart ); 220 if ( nEnd != nLen - RTL_CONSTASCII_LENGTH( "\">" ) ) 221 return false; 222 223 rtl::OUString sNamesp = rFullName.copy( nStart, nEnd - nStart ); 224 if ( !( nLen = sNamesp.getLength() ) ) 225 return false; 226 227 rtl::OUStringBuffer aBuff( sNamesp ); 228 if ( sNamesp[nLen - 1] != '/' ) 229 aBuff.append( sal_Unicode( '/' ) ); 230 aBuff.append( sPropName ); 231 rParsedName = aBuff.makeStringAndClear(); 232 233 return rParsedName.getLength(); 234} |
|