WARNING: USE THIS SOFTWARE AT YOUR OWN RISK! THIS IS EXPERIMENTAL SOFTWARE NOT INTENDED FOR PRODUCTION USE! Zuble is currently an early stage prototype. As such Zuble is minimally tested and inherently unstable. It is provided for experimental, development, and demonstration purposes only. Zuble QML Types   |  Zuble C++ Classes   |  Zuble Overview
Zuble  0.1
Zuble Framework C++/QML extension API
Signals | Public Member Functions | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Zbl::ZTableFile Class Reference

This class in theory allows reading and writing of ZTableModel objects to JSON files. (TBD: currently unused/untested?) More...

#include <ZTableFile.h>

Inheritance diagram for Zbl::ZTableFile:
Inheritance graph
[legend]
Collaboration diagram for Zbl::ZTableFile:
Collaboration graph
[legend]

Signals

void fileModified (const QString &path)
 Sent whenever the data file is modified by this or other programs. More...
 

Public Member Functions

 ZTableFile (QObject *parent=0)
 
Q_INVOKABLE bool readFile (const QString &filePath)
 Reads the specified table file into the data table. Previous data in the table is discarded. More...
 
Q_INVOKABLE bool writeFile (const QString &filePath)
 Writes the data table to the specified file. Returns true if successful; otherwise returns false. More...
 

Protected Member Functions

ZBL_DECLARE_LOGGED_OBJECT void validateWatcher ()
 

Protected Attributes

QString m_filePath
 Path to the file that was last read or written. More...
 
QFileSystemWatcher * m_watcher
 Monitors table data file for updates from this and other applications. More...
 
ZTableModelm_data
 The data model that will send or receive data. More...
 

Static Protected Attributes

static qint64 m_maxFileBytes = 100000 * 1024
 

Detailed Description

This class in theory allows reading and writing of ZTableModel objects to JSON files. (TBD: currently unused/untested?)

Definition at line 44 of file ZTableFile.h.

Constructor & Destructor Documentation

◆ ZTableFile()

Zbl::ZTableFile::ZTableFile ( QObject *  parent = 0)
explicit

Definition at line 41 of file ZTableFile.cpp.

Member Function Documentation

◆ fileModified

void Zbl::ZTableFile::fileModified ( const QString &  path)
signal

Sent whenever the data file is modified by this or other programs.

Parameters
pathPath to the data file.

Referenced by ZTableFile().

◆ readFile()

bool Zbl::ZTableFile::readFile ( const QString &  filePath)

Reads the specified table file into the data table. Previous data in the table is discarded.

Parameters
filePathpath of the file to read. Returns true if successful; otherwise returns false.

Definition at line 79 of file ZTableFile.cpp.

◆ validateWatcher()

void Zbl::ZTableFile::validateWatcher ( )
protected

Definition at line 57 of file ZTableFile.cpp.

◆ writeFile()

bool Zbl::ZTableFile::writeFile ( const QString &  filePath)

Writes the data table to the specified file. Returns true if successful; otherwise returns false.

Definition at line 172 of file ZTableFile.cpp.

Member Data Documentation

◆ m_data

ZTableModel* Zbl::ZTableFile::m_data
protected

The data model that will send or receive data.

Definition at line 102 of file ZTableFile.h.

Referenced by readFile(), writeFile(), and ZTableFile().

◆ m_filePath

QString Zbl::ZTableFile::m_filePath
protected

Path to the file that was last read or written.

Definition at line 89 of file ZTableFile.h.

Referenced by readFile(), and writeFile().

◆ m_maxFileBytes

qint64 Zbl::ZTableFile::m_maxFileBytes = 100000 * 1024
staticprotected

Definition at line 105 of file ZTableFile.h.

Referenced by readFile().

◆ m_watcher

QFileSystemWatcher* Zbl::ZTableFile::m_watcher
protected

Monitors table data file for updates from this and other applications.

Definition at line 96 of file ZTableFile.h.

Referenced by readFile(), validateWatcher(), writeFile(), and ZTableFile().


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