netwerk/mime/nsMIMEHeaderParamImpl.h
author Gregory Szorc <gps@mozilla.com>
Wed, 28 Jan 2015 13:37:00 -0800
branchCAL170_20121012_RELBRANCH
changeset 110539 95d65385e289290923953dd2711c53e8561cbfce
parent 98529 f4157e8c410708d76703f19e4dfb61859bfe32d8
permissions -rw-r--r--
Close old release branch CAL170_20121012_RELBRANCH

/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "nsIMIMEHeaderParam.h"

#ifndef __nsmimeheaderparamimpl_h___
#define __nsmimeheaderparamimpl_h___
class nsMIMEHeaderParamImpl : public nsIMIMEHeaderParam
{
public:
  NS_DECL_ISUPPORTS
  NS_DECL_NSIMIMEHEADERPARAM

  nsMIMEHeaderParamImpl() {}
  virtual ~nsMIMEHeaderParamImpl() {}
private:
  // Toggles support for RFC 2231 decoding, or RFC 5987 (5987 profiles 2231
  // for use in HTTP, and, for instance, drops support for continuations)
  enum ParamDecoding {
    RFC_2231_DECODING = 1,
    RFC_5987_DECODING
  }; 

  nsresult DoGetParameter(const nsACString& aHeaderVal, 
                          const char *aParamName,
                          ParamDecoding aDecoding,
                          const nsACString& aFallbackCharset, 
                          bool aTryLocaleCharset, 
                          char **aLang, 
                          nsAString& aResult);

  nsresult DoParameterInternal(const char *aHeaderValue, 
                               const char *aParamName,
                               ParamDecoding aDecoding,
                               char **aCharset,
                               char **aLang,
                               char **aResult);

};

#endif