MCPcopy Create free account
hub / github.com/MhmRdd/NoHello / parseMountinfo

Method parseMountinfo

module/src/main/cpp/MountRuleParser.cpp:136–155  ·  view source on GitHub ↗

Used previously for testing its effectiveness

Source from the content-addressed store, hash-verified

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)) {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected