OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/file_util.h" | 5 #include "base/file_util.h" |
6 | 6 |
7 #include <windows.h> | 7 #include <windows.h> |
8 #include <shellapi.h> | 8 #include <shellapi.h> |
9 #include <shlobj.h> | 9 #include <shlobj.h> |
10 #include <time.h> | 10 #include <time.h> |
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
732 ::CloseHandle(file_mapping_); | 732 ::CloseHandle(file_mapping_); |
733 if (file_ != INVALID_HANDLE_VALUE) | 733 if (file_ != INVALID_HANDLE_VALUE) |
734 ::CloseHandle(file_); | 734 ::CloseHandle(file_); |
735 | 735 |
736 data_ = NULL; | 736 data_ = NULL; |
737 file_mapping_ = file_ = INVALID_HANDLE_VALUE; | 737 file_mapping_ = file_ = INVALID_HANDLE_VALUE; |
738 length_ = INVALID_FILE_SIZE; | 738 length_ = INVALID_FILE_SIZE; |
739 } | 739 } |
740 | 740 |
741 // Deprecated functions ---------------------------------------------------- | 741 // Deprecated functions ---------------------------------------------------- |
| 742 |
742 void InsertBeforeExtension(std::wstring* path_str, | 743 void InsertBeforeExtension(std::wstring* path_str, |
743 const std::wstring& suffix) { | 744 const std::wstring& suffix) { |
744 FilePath path(*path_str); | 745 FilePath path(*path_str); |
745 InsertBeforeExtension(&path, suffix); | 746 InsertBeforeExtension(&path, suffix); |
746 path_str->assign(path.value()); | 747 path_str->assign(path.value()); |
747 } | 748 } |
748 void PathComponents(const std::wstring& path, | 749 void PathComponents(const std::wstring& path, |
749 std::vector<std::wstring>* components) { | 750 std::vector<std::wstring>* components) { |
750 PathComponents(FilePath(path), components); | 751 PathComponents(FilePath(path), components); |
751 } | 752 } |
752 void ReplaceExtension(std::wstring* file_name, const std::wstring& extension) { | 753 void ReplaceExtension(std::wstring* file_name, const std::wstring& extension) { |
753 FilePath path(*file_name); | 754 FilePath path(*file_name); |
754 ReplaceExtension(&path, extension); | 755 ReplaceExtension(&path, extension); |
755 file_name->assign(path.value()); | 756 file_name->assign(path.value()); |
756 } | 757 } |
757 } // namespace file_util | 758 } // namespace file_util |
OLD | NEW |