Revert of Merge duplicate code in invalidation helper. (patchset #2 id:40001 of https...
[chromium-blink-merge.git] / base / nix / mime_util_xdg.h
blobe40415e1c4800245cc6de8fa4ac41fdde476f987
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef BASE_NIX_MIME_UTIL_XDG_H_
6 #define BASE_NIX_MIME_UTIL_XDG_H_
8 #include <string>
10 #include "base/base_export.h"
11 #include "build/build_config.h"
13 namespace base {
15 class FilePath;
17 namespace nix {
19 // Gets the mime type for a file based on its filename. The file path does not
20 // have to exist. Please note because it doesn't touch the disk, this does not
21 // work for directories.
22 // If the mime type is unknown, this will return application/octet-stream.
23 BASE_EXPORT std::string GetFileMimeType(const FilePath& filepath);
25 // Get the mime type for a byte vector.
26 BASE_EXPORT std::string GetDataMimeType(const std::string& data);
28 } // namespace nix
29 } // namespace base
31 #endif // BASE_NIX_MIME_UTIL_XDG_H_