- SeparatorConversion sep_conversion = SEP_TO_SLASH;
- if (args.size() > kArgIndexPathConversion) {
- if (convert_to_system_absolute) {
- *err = Err(function, "Can't specify slash conversion.",
- "You specified absolute system path output by using an empty string "
- "for the destination directory on rebase_path(). In this case, you "
- "can't specify slash conversion.");
- return result;
- }
-
- if (!args[kArgIndexPathConversion].VerifyTypeIs(Value::STRING, err))
- return result;
- const std::string& sep_string =
- args[kArgIndexPathConversion].string_value();
- if (sep_string == "to_slash") {
- sep_conversion = SEP_TO_SLASH;
- } else if (sep_string == "to_system") {
- sep_conversion = SEP_TO_SYSTEM;
- } else {
- *err = Err(args[kArgIndexPathConversion],
- "Invalid path separator conversion mode.",
- "I was expecting \"to_slash\" or \"to_system\" and\n"
- "you gave me \"" + args[kArgIndexPathConversion].string_value() +
- "\".");
- return result;
- }
- }
-