Audacity  3.0.3
Public Member Functions | Private Attributes | List of all members
EnumValueSymbols Class Reference

#include <Prefs.h>

Inheritance diagram for EnumValueSymbols:
[legend]
Collaboration diagram for EnumValueSymbols:
[legend]

Public Member Functions

 EnumValueSymbols ()=default
 
 EnumValueSymbols (std::initializer_list< EnumValueSymbol > symbols)
 
 EnumValueSymbols (ByColumns_t, const TranslatableStrings &msgids, wxArrayStringEx internals)
 
const TranslatableStringsGetMsgids () const
 
const wxArrayStringExGetInternals () const
 

Private Attributes

TranslatableStrings mMsgids
 
wxArrayStringEx mInternals
 

Detailed Description

A table of EnumValueSymbol that you can access by "row" with operator [] but also allowing access to the "columns" of internal or translated strings, and also allowing convenient column-wise construction

Definition at line 238 of file Prefs.h.

Constructor & Destructor Documentation

◆ EnumValueSymbols() [1/3]

EnumValueSymbols::EnumValueSymbols ( )
default

◆ EnumValueSymbols() [2/3]

EnumValueSymbols::EnumValueSymbols ( std::initializer_list< EnumValueSymbol symbols)
inline

Definition at line 242 of file Prefs.h.

243  : vector( symbols )
244  {}

◆ EnumValueSymbols() [3/3]

EnumValueSymbols::EnumValueSymbols ( ByColumns_t  ,
const TranslatableStrings msgids,
wxArrayStringEx  internals 
)

Definition at line 238 of file Prefs.cpp.

243  : mInternals( std::move( internals ) )
244 {
245  auto size = mInternals.size(), size2 = msgids.size();
246  if ( size != size2 ) {
247  wxASSERT( false );
248  size = std::min( size, size2 );
249  }
250  reserve( size );
251  auto iter1 = mInternals.begin();
252  auto iter2 = msgids.begin();
253  while( size-- )
254  emplace_back( *iter1++, *iter2++ );
255 }

References min(), and mInternals.

Here is the call graph for this function:

Member Function Documentation

◆ GetInternals()

const wxArrayStringEx & EnumValueSymbols::GetInternals ( ) const

Definition at line 265 of file Prefs.cpp.

266 {
267  if ( mInternals.empty() )
268  mInternals = transform_container<wxArrayStringEx>( *this,
269  std::mem_fn( &EnumValueSymbol::Internal ) );
270  return mInternals;
271 }

References ComponentInterfaceSymbol::Internal(), and mInternals.

Referenced by anonymous_namespace{GetInfoCommand.cpp}::ShuttleGuiGetDefinition::TieChoice().

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

◆ GetMsgids()

const TranslatableStrings & EnumValueSymbols::GetMsgids ( ) const

Definition at line 257 of file Prefs.cpp.

258 {
259  if ( mMsgids.empty() )
260  mMsgids = transform_container<TranslatableStrings>( *this,
261  std::mem_fn( &EnumValueSymbol::Msgid ) );
262  return mMsgids;
263 }

References mMsgids, and ComponentInterfaceSymbol::Msgid().

Here is the call graph for this function:

Member Data Documentation

◆ mInternals

wxArrayStringEx EnumValueSymbols::mInternals
mutableprivate

Definition at line 261 of file Prefs.h.

Referenced by EnumValueSymbols(), and GetInternals().

◆ mMsgids

TranslatableStrings EnumValueSymbols::mMsgids
mutableprivate

Definition at line 260 of file Prefs.h.

Referenced by GetMsgids().


The documentation for this class was generated from the following files:
ComponentInterfaceSymbol::Msgid
const TranslatableString & Msgid() const
Definition: ComponentInterfaceSymbol.h:56
EnumValueSymbols::mMsgids
TranslatableStrings mMsgids
Definition: Prefs.h:260
EnumValueSymbols::mInternals
wxArrayStringEx mInternals
Definition: Prefs.h:261
min
int min(int a, int b)
Definition: CompareAudioCommand.cpp:106
ComponentInterfaceSymbol::Internal
const wxString & Internal() const
Definition: ComponentInterfaceSymbol.h:55