Audacity 3.2.0
Public Member Functions | Private Attributes | Friends | List of all members
ComponentInterfaceSymbol Class Reference

ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional, different string as msgid for lookup in a translation catalog. More...

#include <ComponentInterfaceSymbol.h>

Collaboration diagram for ComponentInterfaceSymbol:
[legend]

Public Member Functions

 ComponentInterfaceSymbol ()=default
 
 ComponentInterfaceSymbol (const TranslatableString &msgid)
 
 ComponentInterfaceSymbol (const wxString &internal)
 
 ComponentInterfaceSymbol (const wxChar *msgid)
 
 ComponentInterfaceSymbol (const Identifier &internal, const TranslatableString &msgid)
 
const wxString & Internal () const
 
const TranslatableStringMsgid () const
 
const TranslatableString Stripped () const
 
const wxString Translation () const
 
const wxString StrippedTranslation () const
 
bool empty () const
 

Private Attributes

wxString mInternal
 
TranslatableString mMsgid
 

Friends

bool operator== (const ComponentInterfaceSymbol &a, const ComponentInterfaceSymbol &b)
 Comparator for such as find_if, using internal name only. More...
 
bool operator!= (const ComponentInterfaceSymbol &a, const ComponentInterfaceSymbol &b)
 
bool operator< (const ComponentInterfaceSymbol &a, const ComponentInterfaceSymbol &b)
 Comparator for use in ordered containers, using internal name only. More...
 

Detailed Description

ComponentInterfaceSymbol pairs a persistent string identifier used internally with an optional, different string as msgid for lookup in a translation catalog.

If there is need to change a msgid in a later version of the program, change the constructor call to supply a second argument but leave the first the same, so that compatibility of older configuration files containing that internal string is not broken.

Definition at line 26 of file ComponentInterfaceSymbol.h.

Constructor & Destructor Documentation

◆ ComponentInterfaceSymbol() [1/5]

ComponentInterfaceSymbol::ComponentInterfaceSymbol ( )
default

◆ ComponentInterfaceSymbol() [2/5]

ComponentInterfaceSymbol::ComponentInterfaceSymbol ( const TranslatableString msgid)
inline

Definition at line 32 of file ComponentInterfaceSymbol.h.

33 : mInternal{ msgid.MSGID().GET(), }, mMsgid{ msgid }
34 {}
const wxString & GET() const
Explicit conversion to wxString, meant to be ugly-looking and demanding of a comment why it's correct...
Definition: Identifier.h:66
Identifier MSGID() const
MSGID is the English lookup key in the catalog, not necessarily for user's eyes if locale is some oth...

◆ ComponentInterfaceSymbol() [3/5]

ComponentInterfaceSymbol::ComponentInterfaceSymbol ( const wxString &  internal)
inline

Definition at line 37 of file ComponentInterfaceSymbol.h.

39 {}

◆ ComponentInterfaceSymbol() [4/5]

ComponentInterfaceSymbol::ComponentInterfaceSymbol ( const wxChar *  msgid)
inline

Definition at line 42 of file ComponentInterfaceSymbol.h.

43 : mInternal{ msgid }, mMsgid{ msgid, {} }
44 {}

◆ ComponentInterfaceSymbol() [5/5]

ComponentInterfaceSymbol::ComponentInterfaceSymbol ( const Identifier internal,
const TranslatableString msgid 
)
inline

Definition at line 48 of file ComponentInterfaceSymbol.h.

50 : mInternal{ internal.GET() }
51 // Do not permit non-empty msgid with empty internal
52 , mMsgid{ internal.empty() ? TranslatableString{} : msgid }
53 {}
Holds a msgid for the translation catalog; may also bind format arguments.

Member Function Documentation

◆ empty()

bool ComponentInterfaceSymbol::empty ( ) const
inline

Definition at line 62 of file ComponentInterfaceSymbol.h.

62{ return mInternal.empty(); }

◆ Internal()

const wxString & ComponentInterfaceSymbol::Internal ( ) const
inline

◆ Msgid()

const TranslatableString & ComponentInterfaceSymbol::Msgid ( ) const
inline

Definition at line 56 of file ComponentInterfaceSymbol.h.

56{ return mMsgid; }

Referenced by anonymous_namespace{MenuHelper.cpp}::AddSortedEffectMenuItems(), anonymous_namespace{MenuHelper.cpp}::FixBatchFlags(), EnumValueSymbols::GetMsgids(), ComponentInterface::GetName(), PluginManager::GetName(), Msgids(), and LV2Effect::PopulateUI().

Here is the caller graph for this function:

◆ Stripped()

const TranslatableString ComponentInterfaceSymbol::Stripped ( ) const
inline

Definition at line 57 of file ComponentInterfaceSymbol.h.

57{ return mMsgid.Stripped(); }
TranslatableString Stripped(unsigned options=MenuCodes) const
non-mutating, constructs another TranslatableString object

References TranslatableString::Stripped().

Referenced by SetTrackVisualsCommand::PopulateOrExchange().

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

◆ StrippedTranslation()

const wxString ComponentInterfaceSymbol::StrippedTranslation ( ) const
inline

Definition at line 59 of file ComponentInterfaceSymbol.h.

60 { return Stripped().Translation(); }
const TranslatableString Stripped() const
wxString Translation() const

Referenced by MacroCommandsCatalog::ByFriendlyName(), and MacroCommandsCatalog::MacroCommandsCatalog().

Here is the caller graph for this function:

◆ Translation()

const wxString ComponentInterfaceSymbol::Translation ( ) const
inline

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( const ComponentInterfaceSymbol a,
const ComponentInterfaceSymbol b 
)
friend

Definition at line 69 of file ComponentInterfaceSymbol.h.

71 { return !( a == b ); }

◆ operator<

bool operator< ( const ComponentInterfaceSymbol a,
const ComponentInterfaceSymbol b 
)
friend

Comparator for use in ordered containers, using internal name only.

Definition at line 74 of file ComponentInterfaceSymbol.h.

76 { return a.mInternal < b.mInternal; }

◆ operator==

bool operator== ( const ComponentInterfaceSymbol a,
const ComponentInterfaceSymbol b 
)
friend

Comparator for such as find_if, using internal name only.

Definition at line 65 of file ComponentInterfaceSymbol.h.

67 { return a.mInternal == b.mInternal; }

Member Data Documentation

◆ mInternal

wxString ComponentInterfaceSymbol::mInternal
private

Definition at line 79 of file ComponentInterfaceSymbol.h.

◆ mMsgid

TranslatableString ComponentInterfaceSymbol::mMsgid
private

Definition at line 80 of file ComponentInterfaceSymbol.h.


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