Tome
A generic data editor for games supporting arbitrary input and output formats.
Public Member Functions | List of all members
Tome::RecordNameValidator Class Reference

Validates record names, ensuring they're not empty and don't start or end with spaces. More...

#include <recordnamevalidator.h>

Inheritance diagram for Tome::RecordNameValidator:

Public Member Functions

 RecordNameValidator (QObject *parent=Q_NULLPTR)
 Constructs a new validator for record names. More...
 
virtual void fixup (QString &input) const Q_DECL_OVERRIDE
 Removes all leading or trailing spaces from the specified string. More...
 
virtual State validate (QString &input, int &pos) const Q_DECL_OVERRIDE
 Validates the specified input string. More...
 

Detailed Description

Validates record names, ensuring they're not empty and don't start or end with spaces.

Constructor & Destructor Documentation

◆ RecordNameValidator()

RecordNameValidator::RecordNameValidator ( QObject *  parent = Q_NULLPTR)

Constructs a new validator for record names.

Parameters
parentOptional owner object.

Member Function Documentation

◆ fixup()

void RecordNameValidator::fixup ( QString &  input) const
virtual

Removes all leading or trailing spaces from the specified string.

Parameters
inputString to fix up.

◆ validate()

QValidator::State RecordNameValidator::validate ( QString &  input,
int &  pos 
) const
virtual

Validates the specified input string.

Parameters
inputString to validate.
posUnused.
Returns
State::Invalid, if the input string is empty or starts or ends with a space, and State::Acceptable otherwise.

The documentation for this class was generated from the following files: