1
0
mirror of https://github.com/cookiengineer/audacity synced 2025-07-24 16:38:07 +02:00
audacity/src/ProjectFileIORegistry.cpp
Panagiotis Vasilopoulos 44968d3ac3
Rebranding: Replace 'Audacity: A Digital Audio Editor' in source files (#248)
List of commands that were executed in the `src directory`:
* sed -i 's/Audacity: A Digital Audio Editor/Tenacity/g' *.h
* sed -i 's/Audacity: A Digital Audio Editor/Tenacity/g' *.cpp

Signed-off-by: Panagiotis Vasilopoulos <hello@alwayslivid.com>
2021-07-13 09:30:42 +00:00

45 lines
839 B
C++

/**********************************************************************
Tenacity
ProjectFileIORegistry.cpp
Paul Licameli
**********************************************************************/
#include "ProjectFileIORegistry.h"
#include "Identifier.h"
#include <unordered_map>
#include <wx/string.h>
namespace ProjectFileIORegistry {
namespace {
using TagTable = std::unordered_map< wxString, TagHandlerFactory >;
static TagTable &sTagTable()
{
static TagTable theTable;
return theTable;
}
}
Entry::Entry(
const wxString &tag, const TagHandlerFactory &factory )
{
sTagTable()[ tag ] = factory;
}
TagHandlerFactory Lookup( const wxString &tag )
{
const auto &table = sTagTable();
auto iter = table.find( tag );
if ( iter == table.end() )
return {};
return iter->second;
}
}