LibreOffice Module desktop (master) 1
minidump_upload.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 */
9
10#include <desktop/minidump.hxx>
11
12#include <iostream>
13#include <string>
14
15#ifdef _WIN32
16#include <memory>
17#include <windows.h>
18
19int wmain(int argc, wchar_t** argv)
20#else
21int main(int argc, char** argv)
22#endif
23{
24 if (argc < 2)
25 {
26 std::cerr << "minidump_upload path_to_ini_file" << std::endl;
27 return EXIT_FAILURE;
28 }
29
30#ifdef _WIN32
31 const int nBytes = WideCharToMultiByte(CP_UTF8, 0, argv[1], -1, nullptr, 0, nullptr, nullptr);
32 auto buf = std::make_unique<char[]>(nBytes);
33 if (WideCharToMultiByte(CP_UTF8, 0, argv[1], -1, buf.get(), nBytes, nullptr, nullptr) == 0)
34 return EXIT_FAILURE;
35 std::string iniPath(buf.get());
36#else
37 std::string iniPath(argv[1]);
38#endif
39 std::string response;
40 if (!crashreport::readConfig(iniPath, &response))
41 return EXIT_FAILURE;
42
43 std::cout << "Response: " << response << std::endl;
44 return EXIT_SUCCESS;
45}
46
47/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
int main(int argc, char **argv)
bool readConfig(const std::string &iniPath, std::string *response)
Read+Send, Test and send info from the Dump.ini .
Definition: minidump.cxx:190
int wmain(int argc, wchar_t *argv[])