| 120 | class MountInfo { |
| 121 | public: |
| 122 | explicit MountInfo(const std::string& line) { |
| 123 | std::istringstream ss(line); |
| 124 | std::vector<std::string> parts; |
| 125 | std::string token; |
| 126 | while (ss >> token) |
| 127 | parts.push_back(token); |
| 128 | auto it = std::find(parts.begin(), parts.end(), std::string("-")); |
| 129 | if (it == parts.end() || std::distance(parts.begin(), it) < 6) |
| 130 | return; |
| 131 | size_t sep_idx = std::distance(parts.begin(), it); |
| 132 | mnt_id = std::stoi(parts[0]); |
| 133 | mnt_parent_id = std::stoi(parts[1]); |
| 134 | parseMajorMinor(parts[2]); |
| 135 | root = parts[3]; |
| 136 | mnt_pnt = parts[4]; |
| 137 | parseFlags(parts[5]); |
| 138 | for (size_t i = 6; i < sep_idx; ++i) |
| 139 | parsePropagation(parts[i]); |
| 140 | fs_type = parts[sep_idx + 1]; |
| 141 | mnt_src = parts[sep_idx + 2]; |
| 142 | parseOptions(parts[sep_idx + 3]); |
| 143 | } |
| 144 | |
| 145 | ~MountInfo() = default; |
| 146 |
nothing calls this directly
no outgoing calls
no test coverage detected