/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* * This file is part of the LibreOffice project. * * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
// when file is not readable, the status eof would not be set // better test of state is okay while (file)
{
std::string line;
std::getline(file, line); int sep = line.find('='); if (sep >= 0)
{
std::string key = line.substr(0, sep);
std::string value = line.substr(sep + 1);
parameters[key] = value;
}
}
return parameters;
}
// Callback to get the response data from server. static size_t WriteCallback(voidconst *ptr, size_t size,
size_t nmemb, void *userp)
{ if (!userp) return 0;
curl_easy_setopt(curl, CURLOPT_URL, url.c_str());
curl_easy_setopt(curl, CURLOPT_USERAGENT, kUserAgent); // Set proxy information if necessary. if (!proxy.empty())
{
curl_easy_setopt(curl, CURLOPT_PROXY, proxy.c_str());
// make sure that at least the mandatory parameters are in there if (parameters.find("DumpFile") == parameters.end())
{ if(response != nullptr)
*response = "ini file needs to contain a key DumpFile!"; returnfalse;
}
if (parameters.find("Version") == parameters.end())
{ if (response != nullptr)
*response = "ini file needs to contain a key Version!"; returnfalse;
}
if (parameters.find("URL") == parameters.end())
{ if (response != nullptr)
*response = "ini file needs to contain a key URL!"; returnfalse;
}
if (response != nullptr) return uploadContent(parameters, *response);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.