File indexing completed on 2024-06-16 05:24:57

0001 /*
0002     This file is part of the Okteta Kasten module, made within the KDE community.
0003 
0004     SPDX-FileCopyrightText: 2008 Friedrich W. H. Kossebau <kossebau@kde.org>
0005 
0006     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0007 */
0008 
0009 #ifndef KASTEN_EXTRACTSTRINGSJOB_HPP
0010 #define KASTEN_EXTRACTSTRINGSJOB_HPP
0011 
0012 // tool
0013 #include "containedstring.hpp"
0014 // Okteta core
0015 #include <Okteta/AddressRange>
0016 // Qt
0017 #include <QObject>
0018 #include <QList>
0019 
0020 namespace Okteta {
0021 class AbstractByteArrayModel;
0022 class CharCodec;
0023 }
0024 
0025 namespace Kasten {
0026 
0027 class ExtractStringsJob : public QObject // not yet: KJob
0028 {
0029     Q_OBJECT
0030 
0031 public:
0032     ExtractStringsJob(const Okteta::AbstractByteArrayModel* model,
0033                       const Okteta::AddressRange& selection,
0034                       const Okteta::CharCodec* charCodec,
0035                       int minLength,
0036                       QList<ContainedString>* containedStringList);
0037 
0038 public:
0039     void exec();
0040 
0041 private:
0042     const Okteta::AbstractByteArrayModel* mByteArrayModel;
0043     const Okteta::AddressRange mSelection;
0044     const Okteta::CharCodec* mCharCodec;
0045     const int mMinLength;
0046 
0047     QList<ContainedString>* mContainedStringList;
0048 };
0049 
0050 inline ExtractStringsJob::ExtractStringsJob(const Okteta::AbstractByteArrayModel* model,
0051                                             const Okteta::AddressRange& selection,
0052                                             const Okteta::CharCodec* charCodec,
0053                                             int minLength,
0054                                             QList<ContainedString>* containedStringList)
0055     : mByteArrayModel(model)
0056     , mSelection(selection)
0057     , mCharCodec(charCodec)
0058     , mMinLength(minLength)
0059     , mContainedStringList(containedStringList)
0060 {}
0061 
0062 }
0063 
0064 #endif