static void ParseArgumentArray()

in src/vswhere.lib/CommandArgs.cpp [259:283]


static void ParseArgumentArray(IteratorType& it, const IteratorType& end, const CommandParser::Token& arg, vector<wstring>& arr)
{
    auto param = it->Value;
    auto nit = next(it);

    // Require arguments if the parameter is specified.
    if (nit == end || CommandParser::Token::eArgument != nit->Type)
    {
        auto message = ResourceManager::FormatString(IDS_E_ARGREQUIRED, param.c_str());
        throw win32_error(ERROR_INVALID_PARAMETER, message);
    }

    while (nit != end)
    {
        if (CommandParser::Token::eParameter == nit->Type)
        {
            break;
        }

        ++it;
        ++nit;

        arr.push_back(it->Value);
    }
}