Lines Matching refs:args

33 Result<void> ParsePermissionsLine(std::vector<std::string>&& args,  in ParsePermissionsLine()  argument
37 if (is_sysfs && !(args.size() == 5 || args.size() == 6)) { in ParsePermissionsLine()
41 if (!is_sysfs && !(args.size() == 4 || args.size() == 5)) { in ParsePermissionsLine()
45 auto it = args.begin(); in ParsePermissionsLine()
74 if (it != args.end()) { in ParsePermissionsLine()
90 Result<void> ParseFirmwareDirectoriesLine(std::vector<std::string>&& args, in ParseFirmwareDirectoriesLine() argument
92 if (args.size() < 2) { in ParseFirmwareDirectoriesLine()
96 std::move(std::next(args.begin()), args.end(), std::back_inserter(*firmware_directories)); in ParseFirmwareDirectoriesLine()
102 std::vector<std::string>&& args, in ParseExternalFirmwareHandlerLine() argument
104 if (args.size() != 4 && args.size() != 5) { in ParseExternalFirmwareHandlerLine()
109 [&args](const auto& other) { return other.devpath == args[1]; }) != in ParseExternalFirmwareHandlerLine()
112 << args[1] << "'"; in ParseExternalFirmwareHandlerLine()
115 passwd* pwd = getpwnam(args[2].c_str()); in ParseExternalFirmwareHandlerLine()
117 return ErrnoError() << "invalid handler uid'" << args[2] << "'"; in ParseExternalFirmwareHandlerLine()
122 if (args.size() == 5) { in ParseExternalFirmwareHandlerLine()
123 struct group* grp = getgrnam(args[3].c_str()); in ParseExternalFirmwareHandlerLine()
125 return ErrnoError() << "invalid handler gid '" << args[3] << "'"; in ParseExternalFirmwareHandlerLine()
131 ExternalFirmwareHandler handler(std::move(args[1]), pwd->pw_uid, gid, in ParseExternalFirmwareHandlerLine()
132 std::move(args[handler_index])); in ParseExternalFirmwareHandlerLine()
138 Result<void> ParseEnabledDisabledLine(std::vector<std::string>&& args, bool* feature) { in ParseEnabledDisabledLine() argument
139 if (args.size() != 2) { in ParseEnabledDisabledLine()
140 return Error() << args[0] << " lines take exactly one parameter"; in ParseEnabledDisabledLine()
143 if (args[1] == "enabled") { in ParseEnabledDisabledLine()
145 } else if (args[1] == "disabled") { in ParseEnabledDisabledLine()
148 return Error() << args[0] << " takes either 'enabled' or 'disabled' as a parameter"; in ParseEnabledDisabledLine()
154 Result<void> ParseParallelRestoreconDirsLine(std::vector<std::string>&& args, in ParseParallelRestoreconDirsLine() argument
156 if (args.size() != 2) { in ParseParallelRestoreconDirsLine()
160 std::move(std::next(args.begin()), args.end(), std::back_inserter(*parallel_restorecon_dirs)); in ParseParallelRestoreconDirsLine()
165 Result<void> ParseUeventSocketRcvbufSizeLine(std::vector<std::string>&& args, in ParseUeventSocketRcvbufSizeLine() argument
167 if (args.size() != 2) { in ParseUeventSocketRcvbufSizeLine()
172 if (!ParseByteCount(args[1], &parsed_size)) { in ParseUeventSocketRcvbufSizeLine()
173 return Error() << "could not parse size '" << args[1] << "' for uevent_socket_rcvbuf_line"; in ParseUeventSocketRcvbufSizeLine()
184 Result<void> ParseSection(std::vector<std::string>&& args, const std::string& filename,
186 Result<void> ParseLineSection(std::vector<std::string>&& args, int line) override;
190 Result<void> ParseDevName(std::vector<std::string>&& args);
191 Result<void> ParseDirName(std::vector<std::string>&& args);
197 Result<void> SubsystemParser::ParseSection(std::vector<std::string>&& args, in ParseSection() argument
199 if (args.size() != 2) { in ParseSection()
203 if (std::find(subsystems_->begin(), subsystems_->end(), args[1]) != subsystems_->end()) { in ParseSection()
207 subsystem_ = Subsystem(std::move(args[1])); in ParseSection()
212 Result<void> SubsystemParser::ParseDevName(std::vector<std::string>&& args) { in ParseDevName() argument
213 if (args[1] == "uevent_devname") { in ParseDevName()
217 if (args[1] == "uevent_devpath") { in ParseDevName()
222 return Error() << "invalid devname '" << args[1] << "'"; in ParseDevName()
225 Result<void> SubsystemParser::ParseDirName(std::vector<std::string>&& args) { in ParseDirName() argument
226 if (args[1].front() != '/') { in ParseDirName()
227 return Error() << "dirname '" << args[1] << " ' does not start with '/'"; in ParseDirName()
230 subsystem_.dir_name_ = args[1]; in ParseDirName()
234 Result<void> SubsystemParser::ParseLineSection(std::vector<std::string>&& args, int line) { in ParseLineSection() argument
235 using OptionParser = Result<void> (SubsystemParser::*)(std::vector<std::string> && args); in ParseLineSection()
243 auto parser = parser_map.Find(args); in ParseLineSection()
247 return std::invoke(*parser, this, std::move(args)); in ParseLineSection()