Prison::MeCard

Search for usage in LXR

#include <mecard.h>

Public Member Functions

 MeCard (MeCard &&other) noexcept
 
 ~MeCard ()
 
QString header () const
 
QStringView headerView () const
 
MeCardoperator= (MeCard &&other) noexcept
 
QVariantMap toVariantMap () const
 
QString value (QStringView key) const
 
QStringList values (QStringView key) const
 

Static Public Member Functions

static std::optional< MeCardparse (const QString &data)
 

Detailed Description

Parser for the MeCard format.

This was originally used for a more compact vCard representation, but today is mostly relevant for Wifi configuration QR codes.

See also
https://en.wikipedia.org/wiki/MeCard_(QR_code)
https://github.com/zxing/zxing/wiki/Barcode-Contents#wi-fi-network-config-android-ios-11
Since
5.101

Definition at line 29 of file mecard.h.

Constructor & Destructor Documentation

◆ MeCard()

MeCard::MeCard ( MeCard && other)
noexcept

Move constructor.

Definition at line 35 of file mecard.cpp.

◆ ~MeCard()

MeCard::~MeCard ( )
default

Destructor.

Member Function Documentation

◆ header()

QString MeCard::header ( ) const

Get the MeCard header.

If you just want to identify the card, use headerView() instead.

Definition at line 109 of file mecard.cpp.

◆ headerView()

QStringView MeCard::headerView ( ) const

Get the MeCard header as a string view.

Useful for identifying the type of card.

Definition at line 114 of file mecard.cpp.

◆ operator=()

MeCard & MeCard::operator= ( MeCard && other)
noexcept

Move assignment.

Definition at line 41 of file mecard.cpp.

◆ parse()

std::optional< MeCard > MeCard::parse ( const QString & data)
static

Parse the given string.

Parameters
dataThe string to parse
Returns
A MeCard, if parsing was successful, a nullopt otherwise.

Definition at line 49 of file mecard.cpp.

◆ toVariantMap()

QVariantMap MeCard::toVariantMap ( ) const

Get the parsed data as QVariantMap.

Definition at line 137 of file mecard.cpp.

◆ value()

QString MeCard::value ( QStringView key) const

Get the value for a given key.

Convenience method for getting the first value if only one value is expected.

Definition at line 119 of file mecard.cpp.

◆ values()

QStringList MeCard::values ( QStringView key) const

Get the list of values for a given key.

Returns
The list of values for the given key

Definition at line 128 of file mecard.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 16:55:54 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.