Remove atrophied terminology (logical -> nickname)

This commit is contained in:
Jeff Young 2024-02-05 11:24:04 +00:00
parent fef404352d
commit 7b3485fcb8
2 changed files with 9 additions and 9 deletions

View File

@ -32,7 +32,7 @@
#include <lib_id.h>
static inline int okLogical( const UTF8& aField )
static int checkLibNickname( const UTF8& aField )
{
// std::string::npos is largest positive number, casting to int makes it -1.
// Returning that means success.
@ -96,12 +96,12 @@ LIB_ID::LIB_ID( const wxString& aLibraryName, const wxString& aItemName ) :
}
int LIB_ID::SetLibNickname( const UTF8& aLogical )
int LIB_ID::SetLibNickname( const UTF8& aLibNickname )
{
int offset = okLogical( aLogical );
int offset = checkLibNickname( aLibNickname );
if( offset == -1 )
m_libraryName = aLogical;
m_libraryName = aLibNickname;
return offset;
}
@ -138,11 +138,11 @@ UTF8 LIB_ID::Format( const UTF8& aLibraryName, const UTF8& aLibItemName )
if( aLibraryName.size() )
{
offset = okLogical( aLibraryName );
offset = checkLibNickname( aLibraryName );
if( offset != -1 )
{
THROW_PARSE_ERROR( _( "Illegal character found in logical library name" ),
THROW_PARSE_ERROR( _( "Illegal character found in library nickname" ),
wxString::FromUTF8( aLibraryName.c_str() ), aLibraryName.c_str(),
0, offset );
}
@ -151,7 +151,7 @@ UTF8 LIB_ID::Format( const UTF8& aLibraryName, const UTF8& aLibItemName )
ret += ':';
}
ret += aLibItemName; // TODO: Add validity test.
ret += aLibItemName;
return ret;
}

View File

@ -88,13 +88,13 @@ public:
const wxString GetUniStringLibNickname() const { return m_libraryName.wx_str(); }
/**
* Override the logical library name portion of the LIB_ID to @a aNickname.
* Override the logical library name portion of the LIB_ID to @a aLibNickname.
*
* @return int - minus 1 (i.e. -1) means success, >= 0 indicates the character offset
* into the parameter at which an error was detected, usually because it
* contained '/' or ':'.
*/
int SetLibNickname( const UTF8& aNickname );
int SetLibNickname( const UTF8& aLibNickname );
/**
* @return the library item name, i.e. footprintName, in UTF8.