UTF8CodePointCountValidator.h 442 B

12345678910111213141516171819202122
  1. // Copyright 2020 Dolphin Emulator Project
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #pragma once
  4. #include <cstddef>
  5. #include <QString>
  6. #include <QValidator>
  7. class UTF8CodePointCountValidator : public QValidator
  8. {
  9. Q_OBJECT
  10. public:
  11. explicit UTF8CodePointCountValidator(std::size_t max_count, QObject* parent = nullptr);
  12. QValidator::State validate(QString& input, int& pos) const override;
  13. private:
  14. std::size_t m_max_count;
  15. };