LibreOffice Module tools (master) 1
Static Public Member Functions | List of all members
INetMIME Class Reference

#include <inetmime.hxx>

Static Public Member Functions

static bool isVisible (sal_uInt32 nChar)
 Check for US-ASCII visible character. More...
 
static bool isAtomChar (sal_uInt32 nChar)
 Check whether some character is valid within an RFC 822 <atom>. More...
 
static bool isIMAPAtomChar (sal_uInt32 nChar)
 Check whether some character is valid within an RFC 2060 <atom>. More...
 
static int getWeight (sal_uInt32 nChar)
 Get the digit weight of a US-ASCII character. More...
 
static int getHexWeight (sal_uInt32 nChar)
 Get the hexadecimal digit weight of a US-ASCII character. More...
 
static bool equalIgnoreCase (const sal_Unicode *pBegin1, const sal_Unicode *pEnd1, const char *pString2)
 Check two US-ASCII strings for equality, ignoring case. More...
 
static bool scanUnsigned (const sal_Unicode *&rBegin, const sal_Unicode *pEnd, bool bLeadingZeroes, sal_uInt32 &rValue)
 
static sal_Unicode const * scanContentType (std::u16string_view rStr, OUString *pType=nullptr, OUString *pSubType=nullptr, INetContentTypeParameterList *pParameters=nullptr)
 Parse the body of an RFC 2045 Content-Type header field. More...
 
static OUString decodeHeaderFieldBody (const OString &rBody)
 
static sal_uInt32 getUTF32Character (const sal_Unicode *&rBegin, const sal_Unicode *pEnd)
 Get the UTF-32 character at the head of a UTF-16 encoded string. More...
 

Detailed Description

Definition at line 77 of file inetmime.hxx.

Member Function Documentation

◆ decodeHeaderFieldBody()

OUString INetMIME::decodeHeaderFieldBody ( const OString &  rBody)
static

Definition at line 1053 of file inetmime.cxx.

References getHexWeight(), isVisible(), nCount, nValue, and p.

Referenced by UNLESS_MERGELIBS().

◆ equalIgnoreCase()

bool INetMIME::equalIgnoreCase ( const sal_Unicode pBegin1,
const sal_Unicode pEnd1,
const char *  pString2 
)
static

Check two US-ASCII strings for equality, ignoring case.

Parameters
pBegin1Points to the start of the first string, must not be null.
pEnd1Points past the end of the first string, must be >= pBegin1.
pString2Points to the start of the null terminated second string, must not be null.
Returns
True if the two strings are equal, ignoring the case of US- ASCII alphabetic characters (US-ASCII 'A'–'Z' and 'a'–'z').

Definition at line 969 of file inetmime.cxx.

References DBG_ASSERT.

Referenced by INetURLObject::setAbsURIRef().

◆ getHexWeight()

int INetMIME::getHexWeight ( sal_uInt32  nChar)
inlinestatic

Get the hexadecimal digit weight of a US-ASCII character.

Parameters
nCharSome UCS-4 character.
Returns
If nChar is a US-ASCII hexadecimal digit character (US-ASCII '0'–'9', 'A'–'F', or 'a'–'f'), return the corresponding weight (0–15); otherwise, return -1.

Definition at line 219 of file inetmime.hxx.

Referenced by decodeHeaderFieldBody(), INetURLObject::getUTF32(), and INetURLObject::parseHost().

◆ getUTF32Character()

sal_uInt32 INetMIME::getUTF32Character ( const sal_Unicode *&  rBegin,
const sal_Unicode pEnd 
)
inlinestatic

Get the UTF-32 character at the head of a UTF-16 encoded string.

Parameters
rBeginPoints to the start of the UTF-16 encoded string, must not be null. On exit, it points past the first UTF-32 character's encoding.
pEndPoints past the end of the UTF-16 encoded string, must be strictly greater than rBegin.
Returns
The UCS-4 character at the head of the UTF-16 encoded string. If the string does not start with the UTF-16 encoding of a UCS-32 character, the first UTF-16 value is returned.

Definition at line 227 of file inetmime.hxx.

Referenced by INetURLObject::getUTF32().

◆ getWeight()

int INetMIME::getWeight ( sal_uInt32  nChar)
inlinestatic

Get the digit weight of a US-ASCII character.

Parameters
nCharSome UCS-4 character.
Returns
If nChar is a US-ASCII (decimal) digit character (US-ASCII '0'–'9'), return the corresponding weight (0–9); otherwise, return -1.

Definition at line 213 of file inetmime.hxx.

Referenced by INetURLObject::parseHost(), and scanUnsigned().

◆ isAtomChar()

bool INetMIME::isAtomChar ( sal_uInt32  nChar)
static

Check whether some character is valid within an RFC 822 <atom>.

Parameters
nCharSome UCS-4 character.
Returns
True if nChar is valid within an RFC 822 <atom> (US-ASCII 'A'–'Z', 'a'–'z', '0'–'9', '!', '#', '$', '', '&', ''', '*', '+', '-', '/', '=', '?', '^', '_', '‘’, '{', '|', '}', or '~').

Definition at line 921 of file inetmime.cxx.

References aMap.

◆ isIMAPAtomChar()

bool INetMIME::isIMAPAtomChar ( sal_uInt32  nChar)
static

Check whether some character is valid within an RFC 2060 <atom>.

Parameters
nCharSome UCS-4 character.
Returns
True if nChar is valid within an RFC 2060 <atom> (US-ASCII 'A'–'Z', 'a'–'z', '0'–'9', '!', '#', '$', '&', ''', '+', ',', '-', '.', '/', ':', ';', '<', '=', '>', '?', '@', '[', ']', '^', '_', '‘’, '|', '}', or '~').

Definition at line 945 of file inetmime.cxx.

References aMap.

Referenced by INetURLObject::setAbsURIRef().

◆ isVisible()

bool INetMIME::isVisible ( sal_uInt32  nChar)
inlinestatic

Check for US-ASCII visible character.

Parameters
nCharSome UCS-4 character.
Returns
True if nChar is a US-ASCII visible character (US-ASCII 0x21–0x7E).

Definition at line 207 of file inetmime.hxx.

Referenced by INetURLObject::appendUCS4(), decodeHeaderFieldBody(), and INetURLObject::parseHostOrNetBiosName().

◆ scanContentType()

sal_Unicode const * INetMIME::scanContentType ( std::u16string_view  rStr,
OUString *  pType = nullptr,
OUString *  pSubType = nullptr,
INetContentTypeParameterList pParameters = nullptr 
)
static

Parse the body of an RFC 2045 Content-Type header field.

Parameters
pBeginThe range (that must be valid) from non-null pBegin, inclusive. to non-null pEnd, exclusive, forms the body of the Content-Type header field. It must be of the form

token "/" token *(";" token "=" (token / quoted-string))

with intervening linear white space and comments (cf. RFCs 822, 2045). The RFC 2231 extensions are supported. The encoding of rMediaType should be US-ASCII, but any Unicode values in the range U+0080..U+FFFF are interpreted 'as appropriate.'

Parameters
pTypeIf not null, returns the type (the first of the above tokens), in US-ASCII encoding and converted to lower case.
pSubTypeIf not null, returns the sub-type (the second of the above tokens), in US-ASCII encoding and converted to lower case.
pParametersIf not null, returns the parameters as a list of INetContentTypeParameters (the attributes are in US-ASCII encoding and converted to lower case, the values are in Unicode encoding). If null, only the syntax of the parameters is checked, but they are not returned.
Returns
Null if the syntax of the field body is incorrect (i.e., does not start with type and sub-type tokens). Otherwise, a pointer past the longest valid input prefix. If null is returned, none of the output parameters will be modified.

Definition at line 1009 of file inetmime.cxx.

References p.

Referenced by INetURLObject::getData().

◆ scanUnsigned()

bool INetMIME::scanUnsigned ( const sal_Unicode *&  rBegin,
const sal_Unicode pEnd,
bool  bLeadingZeroes,
sal_uInt32 &  rValue 
)
static

Definition at line 986 of file inetmime.cxx.

References getWeight(), and p.

Referenced by INetURLObject::GetPort().


The documentation for this class was generated from the following files: