ArnLib  4.0.x
Active Registry Network
ArnQmlMSystem.hpp
Go to the documentation of this file.
1 // Copyright (C) 2010-2022 Michael Wiklund.
2 // All rights reserved.
3 // Contact: arnlib@wiklunden.se
4 //
5 // This file is part of the ArnLib - Active Registry Network.
6 // Parts of ArnLib depend on Qt and/or other libraries that have their own
7 // licenses. Usage of these other libraries is subject to their respective
8 // license agreements.
9 //
10 // GNU Lesser General Public License Usage
11 // This file may be used under the terms of the GNU Lesser General Public
12 // License version 2.1 as published by the Free Software Foundation and
13 // appearing in the file LICENSE_LGPL.txt included in the packaging of this
14 // file. In addition, as a special exception, you may use the rights described
15 // in the Nokia Qt LGPL Exception version 1.1, included in the file
16 // LGPL_EXCEPTION.txt in this package.
17 //
18 // GNU General Public License Usage
19 // Alternatively, this file may be used under the terms of the GNU General Public
20 // License version 3.0 as published by the Free Software Foundation and appearing
21 // in the file LICENSE_GPL.txt included in the packaging of this file.
22 //
23 // Other Usage
24 // Alternatively, this file may be used in accordance with the terms and conditions
25 // contained in a signed written agreement between you and Michael Wiklund.
26 //
27 // This program is distributed in the hope that it will be useful, but WITHOUT ANY
28 // WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
29 // PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
30 //
31 
32 #ifndef ARNQMLMSYSTEM_HPP
33 #define ARNQMLMSYSTEM_HPP
34 
35 #include "ArnLib_global.hpp"
36 #include <QObject>
37 
38 
39 namespace Arn {
40 
41 class QmlMFileIO : public QObject
42 {
43  Q_OBJECT
44 
45 public:
46  Q_PROPERTY( QString path READ path WRITE setPath NOTIFY pathChanged)
47 
48  explicit QmlMFileIO( QObject* parent = arnNullptr);
49 
50  Q_INVOKABLE QString read();
51  Q_INVOKABLE bool write( const QString& data);
52  Q_INVOKABLE QByteArray readBytes();
53  Q_INVOKABLE bool writeBytes( const QByteArray& data);
54 
55  QString path();
56 
57 public slots:
58  void setPath( const QString& path);
59 
60 signals:
61  void pathChanged( const QString& path);
62  void error( const QString& msg);
63 
64 private:
65  QString _path;
66 };
67 
68 }
69 
70 #endif // ARNQMLMSYSTEM_HPP
QString path()
QmlMFileIO(QObject *parent=arnNullptr)
void pathChanged(const QString &path)
void setPath(const QString &path)
Definition: Arn.cpp:43
Q_INVOKABLE bool write(const QString &data)
Q_INVOKABLE QByteArray readBytes()
Q_INVOKABLE QString read()
void error(const QString &msg)
Q_INVOKABLE bool writeBytes(const QByteArray &data)