qTox  Version: nightly | Commit: bc751c8e1cac455f9690654fcfe0f560d2d7dfdd
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ContactId Class Referenceabstract

#include <contactid.h>

Inheritance diagram for ContactId:
Inheritance graph
Collaboration diagram for ContactId:
Collaboration graph

Public Member Functions

virtual ~ContactId ()
 
 ContactId (const ContactId &)=default
 
ContactId & operator= (const ContactId &)=default
 
 ContactId (ContactId &&)=default
 
ContactId & operator= (ContactId &&)=default
 
bool operator== (const ContactId &other) const
 Compares the equality of the ContactId. More...
 
bool operator!= (const ContactId &other) const
 Compares the inequality of the ContactId. More...
 
bool operator< (const ContactId &other) const
 Compares two ContactIds. More...
 
QString toString () const
 Converts the ContactId to a uppercase hex string. More...
 
QByteArray getByteArray () const
 Get a copy of the id. More...
 
const uint8_t * getData () const
 Returns a pointer to the raw id data. More...
 
bool isEmpty () const
 Checks if the ContactId contains a id. More...
 
virtual int getSize () const =0
 

Protected Member Functions

 ContactId ()
 The default constructor. Creates an empty id. More...
 
 ContactId (const QByteArray &rawId)
 Constructs a ContactId from bytes. More...
 

Protected Attributes

QByteArray id
 

Detailed Description

Definition at line 28 of file contactid.h.

Constructor & Destructor Documentation

◆ ~ContactId()

ContactId::~ContactId ( )
virtualdefault

◆ ContactId() [1/4]

ContactId::ContactId ( const ContactId &  )
default

◆ ContactId() [2/4]

ContactId::ContactId ( ContactId &&  )
default

◆ ContactId() [3/4]

ContactId::ContactId ( )
protected

The default constructor. Creates an empty id.

Definition at line 29 of file contactid.cpp.

◆ ContactId() [4/4]

ContactId::ContactId ( const QByteArray &  rawId)
explicitprotected

Constructs a ContactId from bytes.

Parameters
rawIdThe bytes to construct the ContactId from.

Definition at line 39 of file contactid.cpp.

Member Function Documentation

◆ getByteArray()

QByteArray ContactId::getByteArray ( ) const

Get a copy of the id.

Returns
Copied id bytes

Definition at line 101 of file contactid.cpp.

Here is the caller graph for this function:

◆ getData()

const uint8_t * ContactId::getData ( ) const

Returns a pointer to the raw id data.

Returns
Pointer to the raw id data, which is exactly ContactId::getPkSize() bytes long. Returns a nullptr if the ContactId is empty.

Definition at line 88 of file contactid.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getSize()

virtual int ContactId::getSize ( ) const
pure virtual

Implemented in ToxPk, and GroupId.

◆ isEmpty()

bool ContactId::isEmpty ( ) const

Checks if the ContactId contains a id.

Returns
True if there is a id, False otherwise.

Definition at line 110 of file contactid.cpp.

Here is the caller graph for this function:

◆ operator!=()

bool ContactId::operator!= ( const ContactId &  other) const

Compares the inequality of the ContactId.

Parameters
otherContactId to compare.
Returns
True if both ContactIds are not equal, false otherwise.

Definition at line 59 of file contactid.cpp.

◆ operator<()

bool ContactId::operator< ( const ContactId &  other) const

Compares two ContactIds.

Parameters
otherContactId to compare.
Returns
True if this ContactIds is less than the other ContactId, false otherwise.

Definition at line 69 of file contactid.cpp.

◆ operator=() [1/2]

ContactId& ContactId::operator= ( const ContactId &  )
default

◆ operator=() [2/2]

ContactId& ContactId::operator= ( ContactId &&  )
default

◆ operator==()

bool ContactId::operator== ( const ContactId &  other) const

Compares the equality of the ContactId.

Parameters
otherContactId to compare.
Returns
True if both ContactId are equal, false otherwise.

Definition at line 49 of file contactid.cpp.

◆ toString()

QString ContactId::toString ( ) const

Converts the ContactId to a uppercase hex string.

Returns
QString containing the hex representation of the id

Definition at line 78 of file contactid.cpp.

Here is the caller graph for this function:

Member Data Documentation

◆ id

QByteArray ContactId::id
protected

Definition at line 48 of file contactid.h.


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