Coverage Report

Created: 2018-09-25 14:53

/src/mozilla-central/netwerk/mime/nsMIMEHeaderParamImpl.h
Line
Count
Source (jump to first uncovered line)
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/. */
5
6
#include "nsIMIMEHeaderParam.h"
7
8
#ifndef __nsmimeheaderparamimpl_h___
9
#define __nsmimeheaderparamimpl_h___
10
class nsMIMEHeaderParamImpl : public nsIMIMEHeaderParam
11
{
12
public:
13
  NS_DECL_ISUPPORTS
14
  NS_DECL_NSIMIMEHEADERPARAM
15
16
0
  nsMIMEHeaderParamImpl() = default;
17
18
  /**
19
   * Identical to calling
20
   * GetParameterHTTP(aHeaderVal, aParameterName, EmptyCString(), false, nullptr, aResult)
21
   * See nsIMIMEHeaderParam.idl for more information.
22
   */
23
  static nsresult GetParameterHTTP(const nsACString& aHeaderVal,
24
                                   const char *aParamName,
25
                                   nsAString &aResult);
26
27
private:
28
0
  virtual ~nsMIMEHeaderParamImpl() = default;
29
  enum ParamDecoding {
30
    MIME_FIELD_ENCODING = 1,
31
    HTTP_FIELD_ENCODING
32
  };
33
34
  static nsresult DoGetParameter(const nsACString& aHeaderVal,
35
                                 const char *aParamName,
36
                                 ParamDecoding aDecoding,
37
                                 const nsACString& aFallbackCharset,
38
                                 bool aTryLocaleCharset,
39
                                 char **aLang,
40
                                 nsAString& aResult);
41
42
  static nsresult DoParameterInternal(const char *aHeaderValue,
43
                                      const char *aParamName,
44
                                      ParamDecoding aDecoding,
45
                                      char **aCharset,
46
                                      char **aLang,
47
                                      char **aResult);
48
};
49
50
#endif
51