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.
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2016-04-09 18:47:19 +08:00
|
|
|
#ifndef FFSOPS_H
|
|
|
|
#define FFSOPS_H
|
2015-04-02 16:07:32 +08:00
|
|
|
|
2016-03-01 15:20:44 +08:00
|
|
|
#include <vector>
|
|
|
|
|
2016-10-10 14:05:04 +08:00
|
|
|
#include "basetypes.h"
|
2016-07-07 13:57:45 +08:00
|
|
|
#include "ubytearray.h"
|
|
|
|
#include "ustring.h"
|
2016-03-01 15:20:44 +08:00
|
|
|
#include "treemodel.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-04-17 07:25:44 +08:00
|
|
|
FfsOperations(TreeModel * treeModel) : model(treeModel) {}
|
|
|
|
~FfsOperations() {};
|
|
|
|
|
2016-07-07 13:57:45 +08:00
|
|
|
std::vector<std::pair<UString, UModelIndex> > getMessages() const { return messagesVector; }
|
2016-04-17 07:25:44 +08:00
|
|
|
void clearMessages() { messagesVector.clear(); }
|
2015-04-02 16:07:32 +08:00
|
|
|
|
2016-07-07 13:57:45 +08:00
|
|
|
USTATUS extract(const UModelIndex & index, UString & name, UByteArray & extracted, const UINT8 mode);
|
|
|
|
USTATUS replace(const UModelIndex & index, const UString & data, const UINT8 mode);
|
2016-03-01 15:20:44 +08:00
|
|
|
|
2016-07-07 13:57:45 +08:00
|
|
|
USTATUS remove(const UModelIndex & index);
|
|
|
|
USTATUS rebuild(const UModelIndex & index);
|
2015-04-02 16:07:32 +08:00
|
|
|
|
|
|
|
private:
|
2016-03-01 15:20:44 +08:00
|
|
|
TreeModel* model;
|
2016-07-07 13:57:45 +08:00
|
|
|
std::vector<std::pair<UString, UModelIndex> > messagesVector;
|
2015-04-02 16:07:32 +08:00
|
|
|
|
2016-07-07 13:57:45 +08:00
|
|
|
void msg(const UString & message, const UModelIndex &index = UModelIndex()) {
|
|
|
|
messagesVector.push_back(std::pair<UString, UModelIndex>(message, index));
|
2016-04-17 07:25:44 +08:00
|
|
|
}
|
2015-04-02 16:07:32 +08:00
|
|
|
};
|
|
|
|
|
2016-04-09 18:47:19 +08:00
|
|
|
#endif // FFSOPS_H
|