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 | |
743 void InsertBeforeExtension(std::wstring* path_str, | 742 void InsertBeforeExtension(std::wstring* path_str, |
744 const std::wstring& suffix) { | 743 const std::wstring& suffix) { |
745 FilePath path(*path_str); | 744 FilePath path(*path_str); |
746 InsertBeforeExtension(&path, suffix); | 745 InsertBeforeExtension(&path, suffix); |
747 path_str->assign(path.value()); | 746 path_str->assign(path.value()); |
748 } | 747 } |
749 void PathComponents(const std::wstring& path, | 748 void PathComponents(const std::wstring& path, |
750 std::vector<std::wstring>* components) { | 749 std::vector<std::wstring>* components) { |
751 PathComponents(FilePath(path), components); | 750 PathComponents(FilePath(path), components); |
752 } | 751 } |
753 void ReplaceExtension(std::wstring* file_name, const std::wstring& extension) { | 752 void ReplaceExtension(std::wstring* file_name, const std::wstring& extension) { |
754 FilePath path(*file_name); | 753 FilePath path(*file_name); |
755 ReplaceExtension(&path, extension); | 754 ReplaceExtension(&path, extension); |
756 file_name->assign(path.value()); | 755 file_name->assign(path.value()); |
757 } | 756 } |
758 } // namespace file_util | 757 } // namespace file_util |
OLD | NEW |