Audacity 3.2.0
Public Member Functions | List of all members
wxArrayStringEx Class Reference

Extend wxArrayString with move operations and construction and insertion fromstd::initializer_list. More...

#include <wxArrayStringEx.h>

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

Public Member Functions

 wxArrayStringEx ()=default
 
template<typename Iterator >
 wxArrayStringEx (Iterator start, Iterator finish)
 
template<typename T >
 wxArrayStringEx (std::initializer_list< T > items)
 
 wxArrayStringEx (wxArrayString &&other)
 The move operations can take arguments of the base class wxArrayString. More...
 
wxArrayStringExoperator= (wxArrayString &&other)
 The move operations can take arguments of the base class wxArrayString. More...
 
template<typename T >
iterator insert (const_iterator pos, std::initializer_list< T > items)
 

Detailed Description

Extend wxArrayString with move operations and construction and insertion fromstd::initializer_list.

Definition at line 17 of file wxArrayStringEx.h.

Constructor & Destructor Documentation

◆ wxArrayStringEx() [1/4]

wxArrayStringEx::wxArrayStringEx ( )
default

◆ wxArrayStringEx() [2/4]

template<typename Iterator >
wxArrayStringEx::wxArrayStringEx ( Iterator  start,
Iterator  finish 
)
inline

Definition at line 24 of file wxArrayStringEx.h.

25 {
26 this->reserve( std::distance( start, finish ) );
27 while( start != finish )
28 this->push_back( *start++ );
29 }

◆ wxArrayStringEx() [3/4]

template<typename T >
wxArrayStringEx::wxArrayStringEx ( std::initializer_list< T >  items)
inline

Definition at line 32 of file wxArrayStringEx.h.

33 {
34 this->reserve( this->size() + items.size() );
35 for ( const auto &item : items )
36 this->push_back( item );
37 }

References size.

◆ wxArrayStringEx() [4/4]

wxArrayStringEx::wxArrayStringEx ( wxArrayString &&  other)
inline

The move operations can take arguments of the base class wxArrayString.

Definition at line 40 of file wxArrayStringEx.h.

41 {
42 swap( other );
43 }
void swap(std::unique_ptr< Alg_seq > &a, std::unique_ptr< Alg_seq > &b)
Definition: NoteTrack.cpp:634

References anonymous_namespace{NoteTrack.cpp}::swap().

Here is the call graph for this function:

Member Function Documentation

◆ insert()

template<typename T >
iterator wxArrayStringEx::insert ( const_iterator  pos,
std::initializer_list< T >  items 
)
inline

Definition at line 58 of file wxArrayStringEx.h.

59 {
60 const auto index = pos - ((const wxArrayString*)this)->begin();
61 this->wxArrayString::Insert( {}, index, items.size() );
62 auto result = this->begin() + index, iter = result;
63 for ( auto pItem = items.begin(), pEnd = items.end();
64 pItem != pEnd;
65 ++pItem, ++iter
66 ) {
67 *iter = *pItem;
68 }
69 return result;
70 }
const char * begin(const char *str) noexcept
Definition: StringUtils.h:101

References details::begin().

Referenced by FileHistory::AddFileToHistory(), Importer::GetFileTypes(), and GUIPrefs::Populate().

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

◆ operator=()

wxArrayStringEx & wxArrayStringEx::operator= ( wxArrayString &&  other)
inline

The move operations can take arguments of the base class wxArrayString.

Definition at line 46 of file wxArrayStringEx.h.

47 {
48 if ( this != &other ) {
49 clear();
50 swap( other );
51 }
52 return *this;
53 }

References anonymous_namespace{NoteTrack.cpp}::swap().

Here is the call graph for this function:

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