1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-10-22 06:22:58 +02:00

New library lib-strings for Identifier and internationalization

This commit is contained in:
Paul Licameli
2021-02-16 21:14:33 -05:00
parent 70c4898648
commit 45c6190c51
37 changed files with 75 additions and 50 deletions

View File

@@ -0,0 +1,32 @@
/**********************************************************************
Audacity: A Digital Audio Editor
Identifier.cpp
Paul Licameli split from Internat.cpp
**********************************************************************/
#include "Identifier.h"
#include <wx/arrstr.h> // for wxSplit
Identifier::Identifier(
std::initializer_list<Identifier> components, wxChar separator )
{
if( components.size() < 2 )
{
wxASSERT( false );
return;
}
auto iter = components.begin(), end = components.end();
value = (*iter++).value;
while (iter != end)
value += separator + (*iter++).value;
}
std::vector< Identifier > Identifier::split( wxChar separator ) const
{
auto strings = ::wxSplit( value, separator );
return { strings.begin(), strings.end() };
}