blob: 3521ea053f382dfcba31216d88db5f95b6e77b4f [file] [log] [blame]
// Copyright 2021 The Chromium OS Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// MountEntry objects represent entries in the list of mounts obtained from
// /proc/<pid>/mounts.
#include <string>
#include <vector>
#include <base/files/file_path.h>
#include <base/strings/string_piece.h>
class MountEntry {
MountEntry() : src_{}, dest_{}, type_{}, opts_{} {}
explicit MountEntry(base::StringPiece mount_str);
// Copying the private fields is fine.
MountEntry(const MountEntry& other) = default;
MountEntry& operator=(const MountEntry& other) = default;
// TODO(jorgelo): Implement move constructor so that we can use emplace().
bool IsWX() const;
bool IsUsbDriveOrArchive() const;
bool IsDestInUsrLocal() const;
bool IsNamespaceBindMount() const;
const base::FilePath& src() const { return src_; }
const base::FilePath& dest() const { return dest_; }
const std::string& type() const { return type_; }
base::FilePath src_;
base::FilePath dest_;
std::string type_;
std::vector<std::string> opts_;