Audacity 3.2.0
Classes | Namespaces | Typedefs | Functions
Identifier.h File Reference
#include <vector>
#include <wx/string.h>
Include dependency graph for Identifier.h:

Go to the source code of this file.

Classes

class  Identifier
 An explicitly nonlocalized string, not meant for the user to see. More...
 
struct  std::hash< Identifier >
 
class  TaggedIdentifier< Tag, CaseSensitive >
 Template generates different TaggedIdentifier classes that don't interconvert implicitly. More...
 
struct  std::hash< TaggedIdentifier< Tag, b > >
 

Namespaces

namespace  std
 STL namespace.
 

Typedefs

using PluginPath = wxString
 type alias for identifying a Plugin supplied by a module, each module defining its own interpretation of the strings, which may or may not be as a file system path More...
 
using PluginPaths = std::vector< PluginPath >
 
using RegistryPath = wxString
 
using RegistryPaths = std::vector< RegistryPath >
 
using FileExtension = wxString
 File extension, not including any leading dot. More...
 
using FileExtensions = wxArrayStringEx
 
using FilePath = wxString
 
using FilePaths = wxArrayStringEx
 
using CommandID = TaggedIdentifier< CommandIdTag, false >
 Identifies a menu command or macro. Case-insensitive comparison. More...
 
using CommandIDs = std::vector< CommandID >
 
using ManualPageID = TaggedIdentifier< ManualPageIDTag >
 
using NumericFormatID = TaggedIdentifier< struct NumericFormatIDTag >
 

Functions

bool operator== (const Identifier &x, const Identifier &y)
 Comparisons of Identifiers are case-sensitive. More...
 
bool operator!= (const Identifier &x, const Identifier &y)
 
bool operator< (const Identifier &x, const Identifier &y)
 
bool operator> (const Identifier &x, const Identifier &y)
 
bool operator<= (const Identifier &x, const Identifier &y)
 
bool operator>= (const Identifier &x, const Identifier &y)
 
bool wxFromString (const wxString &str, Identifier *id)
 This lets you pass Identifier into wxFileConfig::Read. More...
 
wxString wxToString (const Identifier &str)
 This lets you pass Identifier into wxFileConfig::Write. More...
 
template<typename Tag1 , typename Tag2 , bool b1, bool b2>
bool operator== (const TaggedIdentifier< Tag1, b1 > &x, const TaggedIdentifier< Tag2, b2 > &y)
 
template<typename Tag1 , typename Tag2 , bool b1, bool b2>
bool operator!= (const TaggedIdentifier< Tag1, b1 > &x, const TaggedIdentifier< Tag2, b2 > &y)
 
template<typename Tag1 , typename Tag2 , bool b1, bool b2>
bool operator< (const TaggedIdentifier< Tag1, b1 > &x, const TaggedIdentifier< Tag2, b2 > &y)
 
template<typename Tag1 , typename Tag2 , bool b1, bool b2>
bool operator> (const TaggedIdentifier< Tag1, b1 > &x, const TaggedIdentifier< Tag2, b2 > &y)
 
template<typename Tag1 , typename Tag2 , bool b1, bool b2>
bool operator<= (const TaggedIdentifier< Tag1, b1 > &x, const TaggedIdentifier< Tag2, b2 > &y)
 
template<typename Tag1 , typename Tag2 , bool b1, bool b2>
bool operator>= (const TaggedIdentifier< Tag1, b1 > &x, const TaggedIdentifier< Tag2, b2 > &y)
 

Typedef Documentation

◆ CommandID

using CommandID = TaggedIdentifier< CommandIdTag, false >

Identifies a menu command or macro. Case-insensitive comparison.

Definition at line 232 of file Identifier.h.

◆ CommandIDs

using CommandIDs = std::vector<CommandID>

Definition at line 233 of file Identifier.h.

◆ FileExtension

using FileExtension = wxString

File extension, not including any leading dot.

Definition at line 224 of file Identifier.h.

◆ FileExtensions

Definition at line 225 of file Identifier.h.

◆ FilePath

using FilePath = wxString

Definition at line 227 of file Identifier.h.

◆ FilePaths

Definition at line 228 of file Identifier.h.

◆ ManualPageID

using ManualPageID = TaggedIdentifier< ManualPageIDTag >

Definition at line 236 of file Identifier.h.

◆ NumericFormatID

using NumericFormatID = TaggedIdentifier<struct NumericFormatIDTag>

Definition at line 238 of file Identifier.h.

◆ PluginPath

using PluginPath = wxString

type alias for identifying a Plugin supplied by a module, each module defining its own interpretation of the strings, which may or may not be as a file system path

Definition at line 214 of file Identifier.h.

◆ PluginPaths

using PluginPaths = std::vector< PluginPath >

Definition at line 215 of file Identifier.h.

◆ RegistryPath

using RegistryPath = wxString

Definition at line 218 of file Identifier.h.

◆ RegistryPaths

using RegistryPaths = std::vector< RegistryPath >

Definition at line 219 of file Identifier.h.

Function Documentation

◆ operator!=() [1/2]

bool operator!= ( const Identifier x,
const Identifier y 
)
inline

Definition at line 78 of file Identifier.h.

79{ return !(x == y); }

◆ operator!=() [2/2]

template<typename Tag1 , typename Tag2 , bool b1, bool b2>
bool operator!= ( const TaggedIdentifier< Tag1, b1 > &  x,
const TaggedIdentifier< Tag2, b2 > &  y 
)
inline

Definition at line 170 of file Identifier.h.

172{ return !(x == y); }

◆ operator<() [1/2]

bool operator< ( const Identifier x,
const Identifier y 
)
inline

Definition at line 81 of file Identifier.h.

82{ return x.GET() < y.GET(); }
const wxString & GET() const
Explicit conversion to wxString, meant to be ugly-looking and demanding of a comment why it's correct...
Definition: Identifier.h:66

References Identifier::GET().

Here is the call graph for this function:

◆ operator<() [2/2]

template<typename Tag1 , typename Tag2 , bool b1, bool b2>
bool operator< ( const TaggedIdentifier< Tag1, b1 > &  x,
const TaggedIdentifier< Tag2, b2 > &  y 
)
inline

Definition at line 175 of file Identifier.h.

177{
178 static_assert( std::is_same_v< Tag1, Tag2 > && b1 == b2,
179 "TaggedIdentifiers with different tags or sensitivity are not comparable" );
180 // This test should be eliminated at compile time:
181 if ( b1 )
182 return x.GET(). Cmp ( y.GET() ) < 0;
183 else
184 return x.GET(). CmpNoCase ( y.GET() ) < 0;
185}

References Identifier::GET().

Here is the call graph for this function:

◆ operator<=() [1/2]

bool operator<= ( const Identifier x,
const Identifier y 
)
inline

Definition at line 87 of file Identifier.h.

88{ return !(y < x); }

◆ operator<=() [2/2]

template<typename Tag1 , typename Tag2 , bool b1, bool b2>
bool operator<= ( const TaggedIdentifier< Tag1, b1 > &  x,
const TaggedIdentifier< Tag2, b2 > &  y 
)
inline

Definition at line 193 of file Identifier.h.

195{ return !(y < x); }

◆ operator==() [1/2]

bool operator== ( const Identifier x,
const Identifier y 
)
inline

Comparisons of Identifiers are case-sensitive.

Definition at line 75 of file Identifier.h.

76{ return x.GET() == y.GET(); }

References Identifier::GET().

Here is the call graph for this function:

◆ operator==() [2/2]

template<typename Tag1 , typename Tag2 , bool b1, bool b2>
bool operator== ( const TaggedIdentifier< Tag1, b1 > &  x,
const TaggedIdentifier< Tag2, b2 > &  y 
)
inline

Comparison of a TaggedIdentifier with an Identifier is allowed, resolving to one of the operators on Identifiers, but always case sensitive. Comparison operators for two TaggedIdentifiers require the same tags and case sensitivity.

Definition at line 157 of file Identifier.h.

159{
160 static_assert( std::is_same_v< Tag1, Tag2 > && b1 == b2,
161 "TaggedIdentifiers with different tags or sensitivity are not comparable" );
162 // This test should be eliminated at compile time:
163 if ( b1 )
164 return x.GET(). Cmp ( y.GET() ) == 0;
165 else
166 return x.GET(). CmpNoCase ( y.GET() ) == 0;
167}

References Identifier::GET().

Here is the call graph for this function:

◆ operator>() [1/2]

bool operator> ( const Identifier x,
const Identifier y 
)
inline

Definition at line 84 of file Identifier.h.

85{ return y < x; }

◆ operator>() [2/2]

template<typename Tag1 , typename Tag2 , bool b1, bool b2>
bool operator> ( const TaggedIdentifier< Tag1, b1 > &  x,
const TaggedIdentifier< Tag2, b2 > &  y 
)
inline

Definition at line 188 of file Identifier.h.

190{ return y < x; }

◆ operator>=() [1/2]

bool operator>= ( const Identifier x,
const Identifier y 
)
inline

Definition at line 90 of file Identifier.h.

91{ return !(x < y); }

◆ operator>=() [2/2]

template<typename Tag1 , typename Tag2 , bool b1, bool b2>
bool operator>= ( const TaggedIdentifier< Tag1, b1 > &  x,
const TaggedIdentifier< Tag2, b2 > &  y 
)
inline

Definition at line 198 of file Identifier.h.

200{ return !(x < y); }

◆ wxFromString()

bool wxFromString ( const wxString &  str,
Identifier id 
)
inline

This lets you pass Identifier into wxFileConfig::Read.

Definition at line 102 of file Identifier.h.

103 { if (id) { *id = str; return true; } else return false; }
#define str(a)

References str.

◆ wxToString()

wxString wxToString ( const Identifier str)
inline

This lets you pass Identifier into wxFileConfig::Write.

Definition at line 106 of file Identifier.h.

106{ return str.GET(); }

References str.