Remove `/` from our forbidden LIB_ID list

It is still forbidden from footprint file names but that is handled
separately and it should not be forbidden in symbol files at all
This commit is contained in:
Seth Hillbrand 2022-08-18 12:49:40 -07:00
parent c53fe1c1f0
commit 97d7ee1f30
3 changed files with 12 additions and 13 deletions

View File

@ -212,7 +212,9 @@ bool LIB_ID::isLegalChar( unsigned aUniChar )
return false;
// This list of characters is also duplicated in validators.cpp and footprint.cpp
// TODO: Unify forbidden character lists
// TODO: Unify forbidden character lists - Warning, invalid filename characters are not the same
// as invalid LIB_ID characters. We will need to separate the FP filenames from FP names before this
// can be unified
switch( aUniChar )
{
case ':':
@ -221,7 +223,6 @@ bool LIB_ID::isLegalChar( unsigned aUniChar )
case '\r':
return false;
case '/':
case '\\':
case '<':
case '>':

View File

@ -32,19 +32,16 @@
/**
* A logical library item identifier and consists of various portions much like a URI.
*
* It consists of of triad of the library nickname, the name of the item in the library,
* and an optional revision of the item. This is a generic library identifier that can be
* It consists of of a dyad of the library nickname and the name of the item in the library
* This is a generic library identifier that can be
* used for any type of library that contains multiple named items such as footprint or
* symbol libraries.
*
* Example LIB_ID string:
* "smt:R_0805/rev0".
* "smt:R_0805".
*
* - "smt" is the logical library name used to look up library information saved in the #LIB_TABLE.
* - "R" is the name of the item within the library.
* - "rev0" is the revision, which is optional. If missing then its delimiter should also not
* be present. A revision must begin with "rev" and be followed by at least one or more
* decimal digits.
*
* @author Dick Hollenbeck
*/
@ -138,7 +135,7 @@ public:
/**
* @return a string in the proper format as an LIB_ID for a combination of
* aLibraryName, aLibItemName, and aRevision.
* aLibraryName, aLibItemName
*
* @throw PARSE_ERROR if any of the pieces are illegal.
*/
@ -148,7 +145,6 @@ public:
* Check if this LID_ID is valid.
*
* A valid #LIB_ID must have both the library nickname and the library item name defined.
* The revision field is optional.
*
* @note A return value of true does not indicated that the #LIB_ID is a valid #LIB_TABLE
* entry.
@ -170,7 +166,7 @@ public:
}
/**
* Clear the contents of the library nickname, library entry name, and revision strings.
* Clear the contents of the library nickname, library entry name
*/
void clear();
@ -184,7 +180,7 @@ public:
/**
* Compare the contents of LIB_ID objects by performing a std::string comparison of the
* library nickname, library entry name, and revision strings respectively.
* library nickname, library entry name
*
* @param aLibId is the LIB_ID to compare against.
* @return -1 if less than \a aLibId, 1 if greater than \a aLibId, and 0 if equal to \a aLibId.

View File

@ -1537,7 +1537,9 @@ const wxChar* FOOTPRINT::StringLibNameInvalidChars( bool aUserReadable )
{
// This list of characters is also duplicated in validators.cpp and
// lib_id.cpp
// TODO: Unify forbidden character lists
// TODO: Unify forbidden character lists - Warning, invalid filename characters are not the same
// as invalid LIB_ID characters. We will need to separate the FP filenames from FP names before this
// can be unified
static const wxChar invalidChars[] = wxT("%$<>\t\n\r\"\\/:");
static const wxChar invalidCharsReadable[] = wxT("% $ < > 'tab' 'return' 'line feed' \\ \" / :");