Audacity 3.2.0
Identifier.cpp
Go to the documentation of this file.
1/**********************************************************************
2
3 Audacity: A Digital Audio Editor
4
5 Identifier.cpp
6
7 Paul Licameli split from Internat.cpp
8
9 **********************************************************************/
10
11#include "Identifier.h"
12#include <wx/arrstr.h> // for wxSplit
13
15 std::initializer_list<Identifier> components, wxChar separator )
16{
17 if( components.size() < 2 )
18 {
19 wxASSERT( false );
20 return;
21 }
22 auto iter = components.begin(), end = components.end();
23 value = (*iter++).value;
24 while (iter != end)
25 value += separator + (*iter++).value;
26}
27
28std::vector< Identifier > Identifier::split( wxChar separator ) const
29{
30 auto strings = ::wxSplit( value, separator );
31 return { strings.begin(), strings.end() };
32}
wxString value
Definition: Identifier.h:71
Identifier()=default
std::vector< Identifier > split(wxChar separator) const
Definition: Identifier.cpp:28
const char * end(const char *str) noexcept
Definition: StringUtils.h:106