1 : // Copyright 2012 Google Inc. All Rights Reserved.
2 : //
3 : // Licensed under the Apache License, Version 2.0 (the "License");
4 : // you may not use this file except in compliance with the License.
5 : // You may obtain a copy of the License at
6 : //
7 : // http://www.apache.org/licenses/LICENSE-2.0
8 : //
9 : // Unless required by applicable law or agreed to in writing, software
10 : // distributed under the License is distributed on an "AS IS" BASIS,
11 : // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 : // See the License for the specific language governing permissions and
13 : // limitations under the License.
14 : //
15 : // Declares some utilities for dealing with paths.
16 :
17 : #ifndef SYZYGY_COMMON_PATH_UTIL_H_
18 : #define SYZYGY_COMMON_PATH_UTIL_H_
19 :
20 : #include "base/files/file_path.h"
21 :
22 m : namespace common {
23 :
24 : // Given a path of the format '\Device\DeviceName\...', converts it to the form
25 : // 'C:\...'. If no matching device name is found, returns the original string.
26 : // This can only fail if the underlying OS API calls fail, in which case an
27 : // error will be logged.
28 : //
29 : // @param device_path The path to be converted.
30 : // @param drive_path The path to be populated with the converted path.
31 : // @returns true on success, false otherwise.
32 m : bool ConvertDevicePathToDrivePath(const base::FilePath& device_path,
33 m : base::FilePath* drive_path);
34 :
35 m : } // namespace common
36 :
37 : #endif // SYZYGY_COMMON_PATH_UTIL_H_
|