ReadFramework
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
rdf::Utils Class Reference

#include <Utils.h>

Public Member Functions

void initFramework () const
 
void registerVersion () const
 
QString createFilePath (const QString &filePath, const QString &attribute, const QString &newSuffix=QString()) const
 Creates a new file path from filePath. Hence, C:.png can be turned into C:-something.xml More...
 
QString baseName (const QString &filePath) const
 Returns the filePath without suffix. C:/temp/something.png -> C:/temp/something This fixes an issue of Qt QFileInfo::baseName which returns wrong basenames if the filename contains dots Qt baseName: Best. 901 Nr. 112 00147.jpg -> Best. This method: Best. 901 Nr. 112 00147.jpg -> Best. 901 Nr. 112 00147 More...
 

Static Public Member Functions

static Utilsinstance ()
 
static double rand ()
 Returns a random number within [0 1]. More...
 
static QJsonObject readJson (const QString &filePath)
 
static int64 writeJson (const QString &filePath, const QJsonObject &jo)
 

Member Function Documentation

QString rdf::Utils::baseName ( const QString &  filePath) const

Returns the filePath without suffix. C:/temp/something.png -> C:/temp/something This fixes an issue of Qt QFileInfo::baseName which returns wrong basenames if the filename contains dots Qt baseName: Best. 901 Nr. 112 00147.jpg -> Best. This method: Best. 901 Nr. 112 00147.jpg -> Best. 901 Nr. 112 00147

Parameters
filePathThe file path.
Returns
The file path without suffix.
QString rdf::Utils::createFilePath ( const QString &  filePath,
const QString &  attribute,
const QString &  newSuffix = QString() 
) const

Creates a new file path from filePath. Hence, C:.png can be turned into C:-something.xml

Parameters
filePathThe old file path.
attributeAn attribute string which is appended to the filename.
newSuffixA new suffix, the old suffix is used if empty.
Returns
The new file path.
void rdf::Utils::initFramework ( ) const
Utils & rdf::Utils::instance ( )
static
double rdf::Utils::rand ( )
static

Returns a random number within [0 1].

Returns
QJsonObject rdf::Utils::readJson ( const QString &  filePath)
static
void rdf::Utils::registerVersion ( ) const
int64 rdf::Utils::writeJson ( const QString &  filePath,
const QJsonObject &  jo 
)
static

The documentation for this class was generated from the following files: