33#include "../inc/urihelper.hxx"
51 if (
nPos < ( rURL.getLength() - 2 ) )
53 OUString aTmp = rURL.copy(
nPos + 1, 2 );
54 rURL = rURL.replaceAt(
nPos + 1, 2, aTmp.toAsciiUpperCase() );
63void PackageUri::init()
const
97 sal_Int32 nParam =
m_aUri.indexOf(
'?' );
101 aPureUri =
m_aUri.copy( 0, nParam );
116 ? std::u16string_view(
u"&purezip" )
117 : std::u16string_view(
u"?purezip" ) );
120 aPureUri = aPureUri.replaceAt( 0,
125 sal_Int32 nEnd = aPureUri.lastIndexOf(
'/' );
134 else if ( nEnd == ( aPureUri.getLength() - 1 ) )
136 if ( aPureUri[ aPureUri.getLength() - 2 ] ==
'/' )
146 aPureUri = aPureUri.copy( 0, nEnd );
150 nEnd = aPureUri.indexOf(
'/', nStart );
155 OUString aNormPackage = aPureUri.copy( nStart );
158 aPureUri = aPureUri.replaceAt(
159 nStart, aPureUri.getLength() - nStart, aNormPackage );
166 :
m_aUri.getLength(), aPureUri );
168 sal_Int32 nLastSlash =
m_aPackage.lastIndexOf(
'/' );
169 if ( nLastSlash != -1 )
178 m_aPath = aPureUri.copy( nEnd + 1 );
185 if (
m_aPath.indexOf(
"//" ) != -1
186 ||
m_aPath.indexOf(
"%2F" ) != -1
187 ||
m_aPath.indexOf(
"%2f" ) != -1
196 OUString aNormPackage = aPureUri.copy( nStart, nEnd - nStart );
199 aPureUri = aPureUri.replaceAt(
200 nStart, nEnd - nStart, aNormPackage );
201 aPureUri = aPureUri.replaceAt(
203 aPureUri.getLength() - nEnd - 1,
212 :
m_aUri.getLength(), aPureUri );
214 sal_Int32 nLastSlash = aPureUri.lastIndexOf(
'/' );
215 if ( nLastSlash != -1 )
219 aPureUri.copy( nLastSlash + 1 ) );
static bool PathHasSegment(std::u16string_view aPath, std::u16string_view aSegment)
OUString encodeURI(const OUString &rURI)
OUString decodeSegment(const OUString &rSegment)
static void normalize(OUString &rURL)
#define PACKAGE_URL_SCHEME
#define PACKAGE_ZIP_URL_SCHEME
#define PACKAGE_URL_SCHEME_LENGTH