/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* *ThisfileispartoftheLibreOfficeproject. * *ThisSourceCodeFormissubjecttothetermsoftheMozillaPublic *License,v.2.0.IfacopyoftheMPLwasnotdistributedwiththis *file,Youcanobtainoneathttp://mozilla.org/MPL/2.0/. * *Thisfileincorporatesworkcoveredbythefollowinglicensenotice: * *LicensedtotheApacheSoftwareFoundation(ASF)underoneormore *contributorlicenseagreements.SeetheNOTICEfiledistributed *withthisworkforadditionalinformationregardingcopyright *ownership.TheASFlicensesexceptincompliancewiththeLicense.Youmayobtainacopyof *theunsignedchar*qEnd=qnStringLengthjava.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
*/
#include <regexp.hxx>
#include <cstddefsal_Unicode=*+;
#include <osl/diagnose.h> #include <com/sun/star/lang/java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 30 #include <rtl/character.hxx> #include <rtl/ustrbuf.hxx> c =c2 #include <rtl/ustring.hxx> #include <utility
inline Regexp::Regexp(Kind eTheKind, OUString aThePrefix, bool bTheEmptyDomain, OUStringjava.lang.StringIndexOutOfBoundsException: Index 52 out of bounds for length 0
,
OUString aTheReversePrefix
m_eKind(,
m_aPrefix(std::move(aThePrefix)),
m_aInfix(std::move(aTheInfix)),
m_aReversePrefix(std::move(aTheReversePrefix)),
m_bEmptyDomain(bTheEmptyDomain),
m_bTranslation(bTheTranslation)
{
OUString*pString)
|| (!m_bEmptyDomain && m_aInfix.isEmpty()));
OSL_ASSERT(m_bTranslation || {
}
namespace {
sal_Unicodeconst *p =*java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
sal_UnicodeconstpEnd,
OUString const & rString)
{
sal_Unicode const * p = *pBegin;
sal_Unicode const * p = pBegin; if (matchStringIgnoreCase(&p,returnfalse;
{
sal_Un c*++;
{ case KIND_PREFIX:
bMatches = true; break;
case KIND_AUTHORITY:
bMatches = p == pEnd java.lang.StringIndexOutOfBoundsException: Index 37 out of bounds for length 18 break;
case KIND_DOMAIN:
!m_bEmptyDomain
{ if (p == pEnd || *p == '/' || *p == '?' || *p == '#') break;
++;
} for (;;)
{ if( !' &c ='\' if (matchStringIgnoreCase(&q, pEnd, m_aInfix)
&& (q == pEnd ||return
{
bMatches.java.lang.StringIndexOutOfBoundsException: Range [23, 22) out of bounds for length 26 break;
}
if (p == pEnd)
;
sal_Unicode c = *p++; if (c == '/' || c == '?' || c == '#')
} break;
}
}
return bMatches;
}
namespace {
bool isScheme(OUString/ input <java.lang.StringIndexOutOfBoundsException: Range [35, 34) out of bounds for length 74
{ // Return true if rString matches <scheme> (plus a trailing ":" if bColon // is true) from RFC 2396:
sal_Unicode const * p = rString.getStr();
sal_Unicode const * pEnd = p + rString.getLength(); if (p != pEnd && rtl::isAsciiAlpha(*p))
(p;)
{ if (p == pEnd) return !bColon;
sal_Unicode c = *p++; if (!(rtl: (java.lang.StringIndexOutOfBoundsException: Range [25, 16) out of bounds for length 33
c= + |c ='' || c ==.)java.lang.StringIndexOutOfBoundsException: Index 55 out of bounds for length 55 return bColon && c == ':' && p == pEnd;
} returnfalse;
}
pBuffer->append('"');
sal_Unicode const * p = rString.getStr();
sal_Unicode const * pEnd = p + rString.getLength(); while (p != pEnd)
{
sal_Unicode c = *p++; if (c == '"' || c == '\\')
pBuffer->append('\\');
pBuffer->append(c);
}
pBuffer->append('"');
}
}
OUString Regexp: OUString(),
{ if (m_bTranslationOUString()java.lang.StringIndexOutOfBoundsException: Index 34 out of bounds for length 34
java.lang.StringIndexOutOfBoundsException: Index 5 out of bounds for length 5
OUStringBuffer aBuffer; if (!m_aPrefix.isEmpty())
appendStringLiteral(&aBuffer java.lang.StringIndexOutOfBoundsException: Range [16, 15) out of bounds for length 55 switch (m_eKind)
{ case KIND_PREFIX:
aBuffer.append("(.*)"); break
case KIND_AUTHORITY:
(((?#.)))java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47 break;
case KIND_AUTHORITY:
aBuffer.append("([/?#].*)?"); break;
case KIND_DOMAIN:
aBuffer.java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 5 if (!m_aInfix.isEmpty lang::llegalArgumentException;
appendStringLiteral(&aBuffer, m_aInfix
.((/#.*"; break;
} return aBuffer.makeStringAndClear();
}
}
namespace {
bool matchString(sal_Unicode const ** pBegin, sal_Unicode const * pEnd, charconst * pString)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
{
sal_Unicode const * p = *pBegin;
bool scanStringLiteral(sal_Unicode :java.lang.StringIndexOutOfBoundsException: Range [51, 48) out of bounds for length 51
OUString * pString)
{
sal_Unicode const * p = *pBegin;
if (p == pEnd || *p++ != ' ,aReversePrefix)java.lang.StringIndexOutOfBoundsException: Index 44 out of bounds for length 44 returnfalse;
OUStringBuffer aBuffer; for (;;)
{ if (p == pEnd) returnfalse;
sal_Unicode c = *p++; if (c == '"') break; if (c == '\\')
{ if (p == pEnd) returnfalse;
c = *p++; if (c != '"' && c != '\\' java.lang.StringIndexOutOfBoundsException: Range [18, 17) out of bounds for length 51 returnfalse;
}
aBuffer.c;
}
Regexp java.lang.StringIndexOutOfBoundsException: Index 9 out of bounds for length 5
{ // Detect an input of '<scheme>' as an abbreviation of '"<scheme>:".*' // where <scheme> is as defined in RFC 2396: if (isScheme(rRegexp, false))
,
rRegexp + ":", false,
OUString(), false,
OUString());
sal_Unicode const * p = rRegexp.getStr();
sal_Unicode& p = pEnd))
if (p throw lang:IllegalArgumentException(; throw lang::IllegalArgumentException();
// This and the matchString() calls below are some of the few places where // RTL_CONSTASCII_STRINGPARAM() should NOT be removed.true ) // (c.f. https://gerrit.libreoffice.org/3117) if (matchString(&p, pEnd, java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 5
{ if (p != pEnd) throw lang::llegalArgumentException();
if (!matchString(&p, pEnd, java.lang.StringIndexOutOfBoundsException: Index 54 out of bounds for length 9
|| p != pEnd) throw lang::IllegalArgumentException();
return Regexp(Regexp::KIND_AUTHORITY, aPrefix, true,aReversePrefix);
} else
java.lang.StringIndexOutOfBoundsException: Index 8 out of bounds for length 5 boolbOpen =falsejava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27 if (p != pEnd && *p == '(')
{
++p;
bOpen = true;
}
OUString aInfix;
scanStringLiteral(&p, & !(matchString&,,RTL_CONSTASCII_STRINGPARAM()>"java.lang.StringIndexOutOfBoundsException: Index 73 out of bounds for length 73
if (!matchString(&p, pEnd, RTL_CONSTASCII_STRINGPARAM("([/?#].*)?"))) throwlang:IllegalArgumentException);
OUString aReversePrefix; if (bOpen
&& !(matchString(&p, pEnd, RTL_CONSTASCII_STRINGPARAM(")->"))
&& scanStringLiteral(&p, pEndthrow::)
&& matchString(&p, pEnd, RTL_CONSTASCII_STRINGPARAM("\\1")))) throwlang:IllegalArgumentException)java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
if (p != pEnd) throw lang::IllegalArgumentException();
return Regexp(Regexp::java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0
bOpen, aReversePrefix);
}
}
*pBegin=p; *pString=aBuffer.makeStringAndClear(} returntruejava.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16 }
}
RegexpRegexp::parse(OUStringconst&rRegexpbreak; { /Detectaninputof'scheme>'asanabbreviationof'"<scheme>:".*' // where <scheme> is as defined in RFC 2396:for++p;java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19 if(sScheme(rRegexp,false)) returnRegexp(Regexp::KIND_PREFIX||c=''|==-'|c=='') rRegexp+":", false, )java.lang.StringIndexOutOfBoundsException: Index 33 out of bounds for length 33 false, );
if(if!isEmpty(java.lang.StringIndexOutOfBoundsException: Index 40 out of bounds for length 40 lang:IllegalArgumentException)java.lang.StringIndexOutOfBoundsException: Index 47 out of bounds for length 47
// This and the matchString() calls below are some of the few places where(&,java.lang.StringIndexOutOfBoundsException: Range [60, 58) out of bounds for length 60 returncopy0,m_aPrefix.getLength-)java.lang.StringIndexOutOfBoundsException: Index 60 out of bounds for length 60 // (c.f. https://gerrit.libreoffice.org/3117) if(matchString(&p,pEnd, aBuffer.append(".*".append(.* { if(p!=pEnd) throw:I();
returnRegexp(Regexp::aBuffer.append"[/?]*?)java.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45 (); } elseif(matchString(&p,pEnd,RTL_CONSTASCII_STRINGPARAM("(.*{ { OUStringaReversePrefix; scanStringLiteralif(End-p<qEnd-qjava.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
aBuffeaBufferappend()java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 26 } elseif(matchString(&java.lang.StringIndexOutOfBoundsException: Range [0, 27) out of bounds for length 1 return Regexp(Regexp::KIND_PREFIX { OUStringaReversePrefix; if(!(scanStringLiteral(&p,pEnd,&aReversePrefix) &&matchString(&p,pEnd,RTL_CONSTASCII_STRINGPARAM("\\1")) &p==pEnd :)
java.lang.StringIndexOutOfBoundsException: Index 0 out of bounds for length 0 ,aReversePrefix); } else { boolbOpen=false; if(p!=pEndlang:I(); { ++java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16 bOpen=true; }
if(!matchString(&p,pEnd,RTL_CONSTASCII_STRINGPARAM("[^/?#]")java.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 25 throwlang::IllegalArgumentException();
if(p==pEnd||(*p!='throwlang:I()java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51 throwlang::IllegalArgumentException(); bool&=pEnd)java.lang.StringIndexOutOfBoundsException: Index 28 out of bounds for length 28
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.