qTox  Version: nightly | Commit: bc751c8e1cac455f9690654fcfe0f560d2d7dfdd
Public Member Functions | List of all members
ToxPk Class Reference

This class represents a Tox Public Key, which is a part of Tox ID. More...

#include <toxpk.h>

Inheritance diagram for ToxPk:
Inheritance graph
Collaboration diagram for ToxPk:
Collaboration graph

Public Member Functions

 ToxPk ()
 The default constructor. Creates an empty Tox key. More...
 
 ToxPk (const ToxPk &other)
 The copy constructor. More...
 
 ToxPk (const QByteArray &rawId)
 Constructs a ToxPk from bytes. More...
 
 ToxPk (const uint8_t *rawId)
 Constructs a ToxPk from bytes. More...
 
 ToxPk (const QString &pk)
 Constructs a ToxPk from a QString. More...
 
int getSize () const override
 Get size of public key in bytes. More...
 
- Public Member Functions inherited from ContactId
virtual ~ContactId ()
 
 ContactId (const ContactId &)=default
 
ContactIdoperator= (const ContactId &)=default
 
 ContactId (ContactId &&)=default
 
ContactIdoperator= (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...
 

Additional Inherited Members

- Protected Member Functions inherited from ContactId
 ContactId ()
 The default constructor. Creates an empty id. More...
 
 ContactId (const QByteArray &rawId)
 Constructs a ContactId from bytes. More...
 
- Protected Attributes inherited from ContactId
QByteArray id
 

Detailed Description

This class represents a Tox Public Key, which is a part of Tox ID.

Definition at line 26 of file toxpk.h.

Constructor & Destructor Documentation

◆ ToxPk() [1/5]

ToxPk::ToxPk ( )

The default constructor. Creates an empty Tox key.

Definition at line 40 of file toxpk.cpp.

◆ ToxPk() [2/5]

ToxPk::ToxPk ( const ToxPk other)

The copy constructor.

Parameters
otherToxPk to copy

Definition at line 49 of file toxpk.cpp.

◆ ToxPk() [3/5]

ToxPk::ToxPk ( const QByteArray &  rawId)
explicit

Constructs a ToxPk from bytes.

Parameters
rawIdThe bytes to construct the ToxPk from. The lenght must be exactly TOX_PUBLIC_KEY_SIZE, else the ToxPk will be empty.

Definition at line 59 of file toxpk.cpp.

◆ ToxPk() [4/5]

ToxPk::ToxPk ( const uint8_t *  rawId)
explicit

Constructs a ToxPk from bytes.

Parameters
rawIdThe bytes to construct the ToxPk from, will read exactly TOX_PUBLIC_KEY_SIZE from the specified buffer.

Definition at line 71 of file toxpk.cpp.

◆ ToxPk() [5/5]

ToxPk::ToxPk ( const QString &  pk)
explicit

Constructs a ToxPk from a QString.

If the given pk isn't a valid Public Key a ToxPk with all zero bytes is created.

Parameters
pkTox Pk string to convert to ToxPk object

Definition at line 83 of file toxpk.cpp.

Member Function Documentation

◆ getSize()

int ToxPk::getSize ( ) const
overridevirtual

Get size of public key in bytes.

Returns
Size of public key in bytes.

Implements ContactId.

Definition at line 99 of file toxpk.cpp.


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