Remoto - VFS: rutils.h Source File
Remoto - VFS
rutils.h
Go to the documentation of this file.
1 #ifndef RUTILS_H
2 #define RUTILS_H
3 
4 #include <QString>
5 #include <QVariant>
6 #include <QByteArray>
7 
8 namespace rutils
9 {
10  QString cleanPath(QString path);
11 
12  QByteArray resourceContents(QString resource, bool *ok=nullptr, bool squashHash=false);
13  QJsonObject jsonResource(QString resource, bool *ok=nullptr);
14 
15  extern QStringList sequenceTypes;
16  QJsonValue parseSequenceSyntax(QString path);
17  QJsonObject sequenceListing(QJsonObject l,QStringList types = sequenceTypes);
18  QStringList expandSequence(QString sequence);
19  QStringList expandSequenceListing(QString sequence);
20 
21  QByteArray encodeBase64Path( QJsonObject p );
22  QJsonObject decodeBase64Path( QByteArray p, bool *ok );
23 
24  QString unescapeXMLAttribute( QString attribute );
25 
26  QStringList exec(QString command, bool *ok=nullptr);
27 }
28 
29 #endif // RUTILS_H
Utility functions for VFS operations.
QStringList expandSequence(QString sequence)
Expand a sequence-notated list into a list of numbers.
Definition: rutils.cpp:407
QString cleanPath(QString path)
Clean and normalize a VFS path.
Definition: rutils.cpp:32
QStringList expandSequenceListing(QString sequence)
Expand a sequence-notated string into a list of names.
Definition: rutils.cpp:499
QStringList sequenceTypes
A list of regular expressions which can represent image or file sequences.
Definition: rutils.cpp:124
QJsonObject decodeBase64Path(QByteArray p, bool *ok)
Decode a base64 string as a JSON object.
Definition: rutils.cpp:613
QStringList exec(QString command, bool *ok=nullptr)
execute a command in a shell, and return the resulting output as a QStringList
Definition: rutils.cpp:658
QJsonObject jsonResource(QString resource, bool *ok=nullptr)
Fetch the contents of a Qt resource as a QJsonObject.
Definition: rutils.cpp:90
QJsonValue parseSequenceSyntax(QString path)
Check if a path or string matches our syntax for file sequences.
Definition: rutils.cpp:132
QJsonObject sequenceListing(QJsonObject l, QStringList types=sequenceTypes)
Given a list of filenames and a regex list, collapse the listing to sequences when possible.
Definition: rutils.cpp:183
QString unescapeXMLAttribute(QString attribute)
Un-escape an XML attribute.
Definition: rutils.cpp:640
QByteArray encodeBase64Path(QJsonObject p)
Encode a JSON object as a base64 string.
Definition: rutils.cpp:592
QByteArray resourceContents(QString resource, bool *ok=nullptr, bool squashHash=false)
Fetch the contents of a Qt resource file.
Definition: rutils.cpp:53