mirror of
https://gitlab.com/comunic/comunicmessages
synced 2025-06-20 00:45:17 +00:00
Can perform user sign in.
This commit is contained in:
16
utils/accountutils.cpp
Normal file
16
utils/accountutils.cpp
Normal file
@ -0,0 +1,16 @@
|
||||
#include <QRegularExpression>
|
||||
|
||||
#include "accountutils.h"
|
||||
|
||||
AccountUtils::AccountUtils()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
bool AccountUtils::CheckEmailAddress(const QString &email)
|
||||
{
|
||||
QRegExp regex("\\b[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,4}\\b");
|
||||
regex.setCaseSensitivity(Qt::CaseInsensitive);
|
||||
regex.setPatternSyntax(QRegExp::RegExp);
|
||||
return regex.exactMatch(email);
|
||||
}
|
26
utils/accountutils.h
Normal file
26
utils/accountutils.h
Normal file
@ -0,0 +1,26 @@
|
||||
/**
|
||||
* Account utilities
|
||||
*
|
||||
* @author Pierre HUBERT
|
||||
*/
|
||||
|
||||
#ifndef ACCOUNTUTILS_H
|
||||
#define ACCOUNTUTILS_H
|
||||
|
||||
#include <QObject>
|
||||
|
||||
class AccountUtils
|
||||
{
|
||||
public:
|
||||
AccountUtils();
|
||||
|
||||
/**
|
||||
* Determine whether an email address is valid or not
|
||||
*
|
||||
* @param email The email address to check
|
||||
* @return TRUE if the email is valid / FALSE else
|
||||
*/
|
||||
bool static CheckEmailAddress(const QString &email);
|
||||
};
|
||||
|
||||
#endif // ACCOUNTUTILS_H
|
6
utils/jsonutils.cpp
Normal file
6
utils/jsonutils.cpp
Normal file
@ -0,0 +1,6 @@
|
||||
#include "jsonutils.h"
|
||||
|
||||
JSONUtils::JSONUtils()
|
||||
{
|
||||
|
||||
}
|
17
utils/jsonutils.h
Normal file
17
utils/jsonutils.h
Normal file
@ -0,0 +1,17 @@
|
||||
/**
|
||||
* JSON utilities
|
||||
*
|
||||
* @author Pierre HUBERT
|
||||
*/
|
||||
|
||||
#ifndef JSONUTILS_H
|
||||
#define JSONUTILS_H
|
||||
|
||||
|
||||
class JSONUtils
|
||||
{
|
||||
public:
|
||||
JSONUtils();
|
||||
};
|
||||
|
||||
#endif // JSONUTILS_H
|
Reference in New Issue
Block a user