Used previously for testing its effectiveness
| 134 | |
| 135 | // Used previously for testing its effectiveness |
| 136 | static MountEntry parseMountinfo(const std::string& line) { |
| 137 | std::istringstream iss(line); |
| 138 | std::vector<std::string> tokens; |
| 139 | std::string token; |
| 140 | |
| 141 | while (iss >> token) tokens.push_back(token); |
| 142 | |
| 143 | auto sep = std::find(tokens.begin(), tokens.end(), "-"); |
| 144 | if (sep == tokens.end() || std::distance(tokens.begin(), sep) < 6) { |
| 145 | LOGE("[MountRuleParser::parseMultipleRules]: Malformed mountinfo line"); |
| 146 | return {}; |
| 147 | } |
| 148 | |
| 149 | MountEntry entry; |
| 150 | entry.root = tokens[3]; |
| 151 | entry.mountPoint = tokens[4]; |
| 152 | entry.fsType = *(sep + 1); |
| 153 | entry.mountSource = *(sep + 2); |
| 154 | return entry; |
| 155 | } |
| 156 | |
| 157 | static MountRule parseRuleString(const std::string& ruleText) { |
| 158 | if (!validateSyntax(ruleText)) { |
nothing calls this directly
no outgoing calls
no test coverage detected