ff7tk  1.2.0.13
Work with Final Fantasy 7 game data
FF7String.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: 2009 - 2022 Arzel Jérôme <myst6re@gmail.com>
2 // SPDX-FileCopyrightText: 2023 Chris Rizzitello <sithlord48@gmail.com>
3 // SPDX-License-Identifier: LGPL-3.0-or-later
4 
5 #pragma once
6 
7 #include <QString>
8 #include <ff7tkdata_export>
9 
13 class FF7TKDATA_EXPORT FF7String
14 {
15 public:
21  explicit FF7String(QByteArrayView data = QByteArrayView());
22 
28  FF7String(const QString &text, bool jp = false);
29 
34  const QByteArray &data() const;
35 
40  QString text() const;
41 
47  void setText(const QString &text, bool jp = false);
48 
54  bool contains(const QRegularExpression &regExp) const;
55 
63  qsizetype indexOf(const QRegularExpression &regExp, qsizetype from, qsizetype &size) const;
64 
72  qsizetype lastIndexOf(const QRegularExpression &regExp, qsizetype &from, qsizetype &size) const;
73 
74  inline bool operator ==(const FF7String &t2) const {
75  return data() == t2.data();
76  }
77  inline bool operator !=(const FF7String &t2) const {
78  return data() != t2.data();
79  }
80 
85  inline bool isJapanese() const {return _jp;}
86 
91  void setJapanese(bool inJapanese);
92 
93 private:
94  QByteArray _data;
95  bool _jp = false;
96 };
FF7String::data
const QByteArray & data() const
data Access the data stored in the FF7String
Definition: FF7String.cpp:21
FF7String::isJapanese
bool isJapanese() const
isJapanese check internal encoding of the text
Definition: FF7String.h:85
FF7String
The FF7String is a container class for FF7Text. Internally it stores the raw data and if the text is ...
Definition: FF7String.h:13