28 #include <wx/translation.h> 57 if( ( partNdx = aId.
find(
':' ) ) != aId.
npos )
91 m_libraryName( aLibraryName ),
92 m_itemName( aItemName )
137 if( aLibraryName.
size() )
144 wxString::FromUTF8( aLibraryName.
c_str() ), aLibraryName.
c_str(),
161 if(
this == &aLibId )
177 for(
auto ch : aLibItemName )
208 bool const space_allowed =
true;
209 bool const illegal_filename_chars_allowed =
false;
229 return illegal_filename_chars_allowed;
232 return space_allowed;
242 for(
unsigned ch : aLibraryName )
254 bool const space_allowed =
true;
266 return space_allowed;
An 8 bit string that is assuredly encoded in UTF8, and supplies special conversion support to and fro...
static constexpr std::string::size_type npos
int compare(const std::string &s) const
static UTF8 FixIllegalChars(const UTF8 &aLibItemName, bool aLib)
Replace illegal LIB_ID item name characters with underscores '_'.
static int okLogical(const UTF8 &aField)
uni_iter uend() const
Return a uni_iter initialized to the end of "this" UTF8 byte sequence.
A logical library item identifier and consists of various portions much like a URI.
static bool isLegalLibraryNameChar(unsigned aUniChar)
Tests whether a Unicode character is a legal LIB_ID library nickname character.
static bool isLegalChar(unsigned aUniChar)
Tests whether a Unicode character is a legal LIB_ID item name character.
int compare(const LIB_ID &aLibId) const
Compare the contents of LIB_ID objects by performing a std::string comparison of the library nickname...
This file contains miscellaneous commonly used macros and functions.
const char * c_str() const
uni_iter ubegin() const
Returns a uni_iter initialized to the start of "this" UTF8 byte sequence.
std::string::size_type find_first_of(const std::string &str, std::string::size_type pos=0) const
std::string::size_type find(char c) const
#define THROW_PARSE_ERROR(aProblem, aSource, aInputLine, aLineNumber, aByteIndex)
int SetLibItemName(const UTF8 &aLibItemName)
Override the library item name portion of the LIB_ID to aLibItemName.
void clear()
Clear the contents of the library nickname, library entry name, and revision strings.
UTF8 m_libraryName
The nickname of the library or empty.
int SetLibNickname(const UTF8 &aNickname)
Override the logical library name portion of the LIB_ID to aNickname.
uni_iter is a non-mutating iterator that walks through unicode code points in the UTF8 encoded string...
int Parse(const UTF8 &aId, bool aFix=false)
Parse LIB_ID with the information from aId.
static int HasIllegalChars(const UTF8 &aLibItemName)
Examine aLibItemName for invalid LIB_ID item name characters.
UTF8 m_itemName
The name of the entry in the logical library.
std::string substr(size_t pos=0, size_t len=npos) const
std::string::size_type size() const
static unsigned FindIllegalLibraryNameChar(const UTF8 &aLibraryName)
Looks for characters that are illegal in library nicknames.