diff options
author | Jochen Nitschke <j.nitschke+logerrit@ok.de> | 2017-04-18 15:23:56 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-04-26 09:16:19 +0200 |
commit | bef9fe6e3decc92bdcec6415b1898e4a0202cc6a (patch) | |
tree | 60283844882d4be3c2ad70081c7271123de07a93 /include/tools | |
parent | 925ed7003b827cd4678547fb762aa002c3a10421 (diff) |
extend unit test for INetMIME::scanContentType
This reverts parts of commit 631b67952909a73ba1851417bd2edbe02ad7be5a
and commit abc6071b7a8af354a56c91e4caecd8afc79f55cc.
some of the removed fields are usefull,
m_bConverted should be checked by callers
fixed 2 bugs and added test cases:
* extended attributes with more than 2 sections were not parsed
* extended attributes with more than 1 section were not parsed
if there was an other attribute
Change-Id: I61ab2af7c5151ef1bcd80cc159fa2b99559374a8
Reviewed-on: https://gerrit.libreoffice.org/36913
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'include/tools')
-rw-r--r-- | include/tools/inetmime.hxx | 21 |
1 files changed, 20 insertions, 1 deletions
diff --git a/include/tools/inetmime.hxx b/include/tools/inetmime.hxx index e2c58b5ea056..cd66173a8d6c 100644 --- a/include/tools/inetmime.hxx +++ b/include/tools/inetmime.hxx @@ -30,6 +30,16 @@ struct INetContentTypeParameter { + /** The optional character set specification (see RFC 2231), in US-ASCII + encoding and converted to lower case. + */ + OString m_sCharset; + + /** The optional language specification (see RFC 2231), in US-ASCII + encoding and converted to lower case. + */ + OString m_sLanguage; + /** The attribute value. If the value is a quoted-string, it is 'unpacked.' If a character set is specified, and the value can be converted to Unicode, this is done. Also, if no character set is @@ -49,9 +59,18 @@ struct INetContentTypeParameter */ OUString m_sValue; + /** This is true if the value is successfully converted to Unicode, and + false if the value is a special mixture of ISO-LATIN-1 characters and + characters from Unicode's Private Use Area. + */ + bool m_bConverted; }; -// the key is the m_sAttribute again; all keys are lower case: +/** The key is the name of the attribute, in US-ASCII encoding and converted + to lower case. If a parameter value is split as described in RFC 2231, + there will only be one item for the complete parameter, with the attribute + name lacking any section suffix. + */ typedef std::unordered_map<OString, INetContentTypeParameter, OStringHash> INetContentTypeParameterList; |