summaryrefslogtreecommitdiffstats
path: root/components/storage_monitor/udev_util_linux.h
blob: e2611cde7d313e14fd26fcc60f8cac32a39d95e8 (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
// Copyright 2014 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 COMPONENTS_STORAGE_MONITOR_UDEV_UTIL_LINUX_H_
#define COMPONENTS_STORAGE_MONITOR_UDEV_UTIL_LINUX_H_

#include <string>

#include "base/memory/scoped_ptr.h"

struct udev_device;

namespace base {
class FilePath;
}

namespace storage_monitor {

// Helper for udev_device_new_from_syspath()/udev_device_get_property_value()
// pair. |device_path| is the absolute path to the device, including /sys.
bool GetUdevDevicePropertyValueByPath(const base::FilePath& device_path,
                                      const char* key,
                                      std::string* result);

}  // namespace storage_monitor

#endif  // COMPONENTS_STORAGE_MONITOR_UDEV_UTIL_LINUX_H_