-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
652 additions
and
191 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,14 @@ | ||
dns.opennic.glue | ||
register.bbs | ||
grep.geek | ||
register.ing | ||
google.com | ||
yahoo.com | ||
wikipedia.org | ||
www.abs.gov.au | ||
opennic.glue | ||
icann;wikipedia.org | ||
icann;www.abs.gov.au | ||
icann;yahoo.com | ||
icann;google.com | ||
icann;360.cn | ||
icann;canada.ca | ||
opennic;dns.opennic.glue | ||
opennic;grep.geek | ||
opennic;opennic.glue | ||
opennic;reg.for.free | ||
opennic;register.bbs | ||
opennic;register.fur | ||
opennic;register.gopher | ||
opennic;register.ing |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,98 @@ | ||
/* | ||
* Copyright (c) 2012 Mike Sharkey <[email protected]> | ||
* | ||
* "THE BEER-WARE LICENSE" (Revision 42): | ||
* Mike Sharkey wrote this file. As long as you retain this notice you | ||
* can do whatever you want with this stuff. If we meet some day, and you think | ||
* this stuff is worth it, you can buy me a beer in return. | ||
*/ | ||
#include "opennicdomainname.h" | ||
|
||
OpenNICDomainName::OpenNICDomainName(QObject *parent) : | ||
QObject(parent) | ||
#include <QString> | ||
#include <QStringList> | ||
|
||
#define ANNONYMOUS_SERVICE "{annon}" | ||
|
||
#define inherited QObject | ||
|
||
OpenNICDomainName::OpenNICDomainName(QObject *parent) | ||
: inherited(parent) | ||
, mDnsService(ANNONYMOUS_SERVICE) | ||
{ | ||
} | ||
|
||
OpenNICDomainName::OpenNICDomainName(QString text, QObject *parent) | ||
: inherited(parent) | ||
{ | ||
fromString(text); | ||
} | ||
|
||
OpenNICDomainName::OpenNICDomainName(const OpenNICDomainName& other) | ||
{ | ||
copy(other); | ||
} | ||
|
||
OpenNICDomainName::~OpenNICDomainName() | ||
{ | ||
} | ||
|
||
/** | ||
* @brief assignment operator | ||
*/ | ||
OpenNICDomainName& OpenNICDomainName::operator=(const OpenNICDomainName& other) | ||
{ | ||
return copy(other); | ||
} | ||
|
||
/** | ||
* @brief equality operator | ||
*/ | ||
bool OpenNICDomainName::operator==(OpenNICDomainName &other) | ||
{ | ||
return toString() == other.toString(); | ||
} | ||
|
||
/** | ||
* @brief unequality operator | ||
*/ | ||
bool OpenNICDomainName::operator!=(OpenNICDomainName &other) | ||
{ | ||
return toString() != other.toString(); | ||
} | ||
|
||
/** | ||
* @brief Copy from another. | ||
*/ | ||
OpenNICDomainName& OpenNICDomainName::copy(const OpenNICDomainName& other) | ||
{ | ||
mDnsService = other.mDnsService; | ||
mDomainName = other.mDomainName; | ||
return *this; | ||
} | ||
|
||
/** | ||
* @brief convert from text. | ||
*/ | ||
void OpenNICDomainName::fromString(QString text) | ||
{ | ||
QStringList parts = text.split(";"); | ||
if (parts.count()>=2) | ||
{ | ||
mDnsService = parts[0].trimmed(); | ||
mDomainName = parts[1].trimmed(); | ||
} | ||
else | ||
{ | ||
mDnsService = ANNONYMOUS_SERVICE; | ||
mDomainName = text; | ||
} | ||
} | ||
|
||
/** | ||
* @brief convert to text | ||
*/ | ||
QString OpenNICDomainName::toString() | ||
{ | ||
return mDnsService.trimmed()+";"+mDomainName.trimmed(); | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,47 @@ | ||
/* | ||
* Copyright (c) 2012 Mike Sharkey <[email protected]> | ||
* | ||
* "THE BEER-WARE LICENSE" (Revision 42): | ||
* Mike Sharkey wrote this file. As long as you retain this notice you | ||
* can do whatever you want with this stuff. If we meet some day, and you think | ||
* this stuff is worth it, you can buy me a beer in return. | ||
*/ | ||
#ifndef OPENNICDOMAINNAME_H | ||
#define OPENNICDOMAINNAME_H | ||
|
||
#include <QObject> | ||
#include <QString> | ||
|
||
/** | ||
* @brief input text is <DNS Service>;<domain name> example: "opennic;www.opennic.glue" | ||
*/ | ||
class OpenNICDomainName : public QObject | ||
{ | ||
Q_OBJECT | ||
public: | ||
explicit OpenNICDomainName(QObject *parent = 0); | ||
Q_OBJECT | ||
public: | ||
OpenNICDomainName(QObject *parent = 0); | ||
OpenNICDomainName(QString text, QObject *parent = 0); | ||
OpenNICDomainName(const OpenNICDomainName& other); | ||
virtual ~OpenNICDomainName(); | ||
|
||
signals: | ||
OpenNICDomainName& copy(const OpenNICDomainName& other); | ||
|
||
public slots: | ||
OpenNICDomainName& operator=(const OpenNICDomainName& other); | ||
bool operator==(OpenNICDomainName &other); | ||
bool operator!=(OpenNICDomainName &other); | ||
|
||
void fromString(QString text); | ||
QString toString(); | ||
|
||
void setDnsService(QString dnsService) {mDnsService=dnsService;} | ||
void setDomainName(QString domainName) {mDomainName=domainName;} | ||
|
||
QString& dnsService() {return mDnsService;} | ||
QString& domainName() {return mDomainName;} | ||
|
||
private: | ||
QString mDnsService; | ||
QString mDomainName; | ||
|
||
}; | ||
|
||
|
Oops, something went wrong.