21#include <rtl/ustrbuf.hxx>
29void DAVProperties::createSerfPropName( ::std::u16string_view
const rFullName,
37 rFullName.substr(RTL_CONSTASCII_LENGTH(
"DAV:")),
38 RTL_TEXTENCODING_UTF8 ).getStr() );
42 rName.
nspace =
"http://apache.org/dav/props/";
46 RTL_CONSTASCII_LENGTH(
47 "http://apache.org/dav/props/" ) ),
48 RTL_TEXTENCODING_UTF8 ).getStr() );
52 rName.
nspace =
"http://ucb.openoffice.org/dav/props/";
56 RTL_CONSTASCII_LENGTH(
57 "http://ucb.openoffice.org/dav/props/" ) ),
58 RTL_TEXTENCODING_UTF8 ).getStr() );
69 sal_Int32 nStart = RTL_CONSTASCII_LENGTH(
"<prop:" );
70 sal_Int32 nLen = aFullName.indexOf(
' ' ) - nStart;
71 rName.
name = strdup( aFullName.copy( nStart, nLen ).getStr() );
73 nStart = aFullName.indexOf(
'=', nStart + nLen ) + 2;
74 nLen = aFullName.getLength() - RTL_CONSTASCII_LENGTH(
"\">" ) - nStart;
75 rName.
nspace = strdup( aFullName.copy( nStart, nLen ).getStr() );
81 assert(rFullName.find(
':') == ::std::u16string_view::npos);
83 rName.
nspace =
"http://ucb.openoffice.org/dav/props/";
86 RTL_TEXTENCODING_UTF8 ).getStr() );
94 OUString & rFullName )
97 = OStringToOUString( nspace, RTL_TEXTENCODING_UTF8 );
99 = OStringToOUString(
name, RTL_TEXTENCODING_UTF8 );
101 if ( !aNameSpace.getLength() )
124 rFullName = aNameSpace;
127 if ( rFullName.startsWith(
"DAV:" ) )
131 else if ( rFullName.startsWith(
"http://apache.org/dav/props/" ) )
135 else if ( rFullName.startsWith(
"http://ucb.openoffice.org/dav/props/" ) )
138 rFullName = rFullName.copy(
139 RTL_CONSTASCII_LENGTH(
140 "http://ucb.openoffice.org/dav/props/" ) );
145 rFullName =
"<prop:";
147 rFullName +=
" xmlns:prop=\"";
148 rFullName += aNameSpace;
158 ( rtl_str_compareIgnoreAsciiCase(
159 rName.
nspace,
"http://ucb.openoffice.org/dav/props/" )
165 size_t nLen = rFullName.size();
171 sal_Int32 nStart = RTL_CONSTASCII_LENGTH(
"<prop:" );
172 size_t nEnd = rFullName.find(
' ', nStart );
173 if ( nEnd == std::u16string_view::npos )
176 std::u16string_view sPropName = rFullName.substr( nStart, nEnd - nStart );
177 if ( sPropName.empty() )
185 nStart = nEnd + RTL_CONSTASCII_LENGTH(
"xmlns:prop=\"" );
186 nEnd = rFullName.find(
'"', nStart );
187 if ( nEnd != nLen - RTL_CONSTASCII_LENGTH(
"\">" ) )
190 std::u16string_view sNamesp = rFullName.substr( nStart, nEnd - nStart );
191 nLen = sNamesp.size();
195 OUStringBuffer aBuff( sNamesp );
196 if ( sNamesp[nLen - 1] !=
'/' )
198 aBuff.append( sPropName );
199 rParsedName = aBuff.makeStringAndClear();
201 return rParsedName.getLength();
bool equalsIgnoreAsciiCase(std::u16string_view s1, std::u16string_view s2)
constexpr bool starts_with(std::basic_string_view< charT, traits > sv, std::basic_string_view< charT, traits > x) noexcept
OString OUStringToOString(std::u16string_view str, ConnectionSettings const *settings)
static void createUCBPropName(const char *nspace, const char *name, OUString &rFullName)
static constexpr OUStringLiteral GETCONTENTTYPE
static constexpr OUStringLiteral SUPPORTEDLOCK
static constexpr OUStringLiteral CREATIONDATE
static bool isUCBDeadProperty(const SerfPropName &rName)
static constexpr OUStringLiteral DISPLAYNAME
static constexpr OUStringLiteral GETETAG
static bool isUCBSpecialProperty(std::u16string_view rFullName, OUString &rParsedName)
static constexpr OUStringLiteral LOCKDISCOVERY
static constexpr OUStringLiteral RESOURCETYPE
static constexpr OUStringLiteral GETCONTENTLENGTH
static constexpr OUStringLiteral GETLASTMODIFIED
static constexpr OUStringLiteral GETCONTENTLANGUAGE