Wireshark 5.1.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
unique_name.h File Reference
#include <QString>

Go to the source code of this file.

Functions

template<typename Candidate, typename IsTaken>
QString uniqueName (Candidate candidate, IsTaken isTaken)

Detailed Description

Wireshark - Network traffic analyzer By Gerald Combs geral.nosp@m.d@wi.nosp@m.resha.nosp@m.rk.o.nosp@m.rg Copyright 1998 Gerald Combs

SPDX-License-Identifier: GPL-2.0-or-later

Function Documentation

◆ uniqueName()

template<typename Candidate, typename IsTaken>
QString uniqueName ( Candidate candidate,
IsTaken isTaken )

Returns the first name candidate(0), candidate(1), ... that isTaken rejects. candidate(0) is the preferred name; later indexes add a counter in the caller's style ("theme-2", "name (copy 1)").

Parameters
candidatecallable taking an int and returning a QString.
isTakencallable taking a const QString & and returning true when that name is in use.