2015-04-02 16:07:32 +08:00
|
|
|
/* fssops.h
|
|
|
|
|
|
|
|
Copyright (c) 2015, Nikolaj Schlej. All rights reserved.
|
|
|
|
This program and the accompanying materials
|
|
|
|
are licensed and made available under the terms and conditions of the BSD License
|
|
|
|
which accompanies this distribution. The full text of the license may be found at
|
|
|
|
http://opensource.org/licenses/bsd-license.php
|
|
|
|
|
|
|
|
THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __FFSOPS_H__
|
|
|
|
#define __FFSOPS_H__
|
|
|
|
|
2016-03-01 15:20:44 +08:00
|
|
|
#include <vector>
|
|
|
|
|
2015-04-02 16:07:32 +08:00
|
|
|
#include <QObject>
|
|
|
|
#include <QByteArray>
|
|
|
|
#include <QString>
|
|
|
|
#include <QModelIndex>
|
|
|
|
|
2016-03-01 15:20:44 +08:00
|
|
|
#include "basetypes.h"
|
|
|
|
#include "treemodel.h"
|
|
|
|
#include "ffs.h"
|
|
|
|
#include "utility.h"
|
2015-04-02 16:07:32 +08:00
|
|
|
|
2016-03-01 15:20:44 +08:00
|
|
|
class FfsOperations
|
2015-04-02 16:07:32 +08:00
|
|
|
{
|
|
|
|
public:
|
2016-03-01 15:20:44 +08:00
|
|
|
explicit FfsOperations(TreeModel * treeModel);
|
2015-04-02 16:07:32 +08:00
|
|
|
~FfsOperations();
|
|
|
|
|
2016-03-01 15:20:44 +08:00
|
|
|
std::vector<std::pair<QString, QModelIndex> > getMessages() const;
|
2015-04-02 16:07:32 +08:00
|
|
|
void clearMessages();
|
|
|
|
|
|
|
|
STATUS extract(const QModelIndex & index, QString & name, QByteArray & extracted, const UINT8 mode);
|
2016-03-01 15:20:44 +08:00
|
|
|
STATUS replace(const QModelIndex & index, const QString & data, const UINT8 mode);
|
|
|
|
|
|
|
|
STATUS remove(const QModelIndex & index);
|
|
|
|
STATUS rebuild(const QModelIndex & index);
|
2015-04-02 16:07:32 +08:00
|
|
|
|
|
|
|
private:
|
2016-03-01 15:20:44 +08:00
|
|
|
TreeModel* model;
|
|
|
|
std::vector<std::pair<QString, QModelIndex> > messagesVector;
|
2015-04-02 16:07:32 +08:00
|
|
|
|
|
|
|
void msg(const QString & message, const QModelIndex &index = QModelIndex());
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|