1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #include "nsIMIMEHeaderParam.h"
8 #ifndef __nsmimeheaderparamimpl_h___
9 # define __nsmimeheaderparamimpl_h___
10 class nsMIMEHeaderParamImpl
: public nsIMIMEHeaderParam
{
13 NS_DECL_NSIMIMEHEADERPARAM
15 nsMIMEHeaderParamImpl() = default;
18 * Identical to calling
19 * GetParameterHTTP(aHeaderVal, aParameterName, ""_ns, false,
20 * nullptr, aResult) See nsIMIMEHeaderParam.idl for more information.
22 static nsresult
GetParameterHTTP(const nsACString
& aHeaderVal
,
23 const char* aParamName
, nsAString
& aResult
);
26 virtual ~nsMIMEHeaderParamImpl() = default;
27 enum ParamDecoding
{ MIME_FIELD_ENCODING
= 1, HTTP_FIELD_ENCODING
};
29 static nsresult
DoGetParameter(const nsACString
& aHeaderVal
,
30 const char* aParamName
,
31 ParamDecoding aDecoding
,
32 const nsACString
& aFallbackCharset
,
33 bool aTryLocaleCharset
, char** aLang
,
36 static nsresult
DoParameterInternal(const nsACString
& aHeaderVal
,
37 const char* aParamName
,
38 ParamDecoding aDecoding
, char** aCharset
,
39 char** aLang
, char** aResult
);
41 static bool ContainsTrailingCharPastNull(const nsACString
& aVal
);