libkpl  6.0
A Library for Graphical Presentation of Data Sets and Functions
utils.h
1/***************************************************************************
2 utils.h - description
3 -------------------
4 begin : Sun Jan 7 2001
5 copyright : (C) 2024 by Werner Stille
6 email : kpl@werner-stille.de
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef UTILS_H
19#define UTILS_H
20
21class QLibrary;
22class QString;
23class QWidget;
24class QUrl;
25
26using namespace Qt::Literals::StringLiterals;
27
32namespace Utils {
40 Q_DECL_EXPORT bool download(const QUrl& src, QString& target,
41 QWidget* window = nullptr);
47 Q_DECL_EXPORT QStringList funcNames(const QString& libPath);
55 Q_DECL_EXPORT bool getFuncAddr(const QString& path, const QString& name,
56 QLibrary** lib, QFunctionPointer* fkt);
64 Q_DECL_EXPORT bool move(const QString& src, const QUrl& dest,
65 QWidget* window = nullptr);
71 Q_DECL_EXPORT QString tempFileName(const QString& suffix = ".tmp"_L1);
76 Q_DECL_EXPORT QUrl url(const QString& s);
77}
78
79#endif
Utility namespace.
Definition utils.h:32
Q_DECL_EXPORT bool download(const QUrl &src, QString &target, QWidget *window=nullptr)
Downloads file.
Q_DECL_EXPORT QUrl url(const QString &s)
Returns URL for given user input, assuming local file.
Q_DECL_EXPORT bool move(const QString &src, const QUrl &dest, QWidget *window=nullptr)
Moves file to remote location.
Q_DECL_EXPORT bool getFuncAddr(const QString &path, const QString &name, QLibrary **lib, QFunctionPointer *fkt)
Gets module handle and address of a shared library function.
Q_DECL_EXPORT QStringList funcNames(const QString &libPath)
Generates sorted list of function names.
Q_DECL_EXPORT QString tempFileName(const QString &suffix=".tmp"_L1)
Generates unique temporary file name.