summaryrefslogtreecommitdiffstats
path: root/net/base/platform_mime_util.h
blob: 6b9099469db83152b607f3e0aa0c5777a6e16d99 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright (c) 2006-2008 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef NET_BASE_PLATFORM_MIME_UTIL_H_
#define NET_BASE_PLATFORM_MIME_UTIL_H_

#include <string>

namespace net {

// Encapsulates the platform-specific functionality in mime_util
class PlatformMimeUtil {
 public:
  // See documentation for base::GetPreferredExtensionForMimeType [mime_util.h]
  bool GetPreferredExtensionForMimeType(const std::string& mime_type,
                                        std::wstring* extension) const;
 protected:
  
  // Get the mime type (if any) that is associated with the file extension.
  // Returns true if a corresponding mime type exists.
  bool GetPlatformMimeTypeFromExtension(const std::wstring& ext,
                                        std::string* mime_type) const;
};

}  // namespace net

#endif  // NET_BASE_PLATFORM_MIME_UTIL_H_