Struct uefi::proto::string::unicode_collation::UnicodeCollation
source · #[repr(C)]pub struct UnicodeCollation { /* private fields */ }
Expand description
The Unicode Collation Protocol.
Used to perform case-insensitive comparisons of strings.
Implementations§
source§impl UnicodeCollation
impl UnicodeCollation
sourcepub fn stri_coll(&self, s1: &CStr16, s2: &CStr16) -> Ordering
pub fn stri_coll(&self, s1: &CStr16, s2: &CStr16) -> Ordering
Performs a case insensitive comparison of two null-terminated strings.
sourcepub fn metai_match(&self, s: &CStr16, pattern: &CStr16) -> bool
pub fn metai_match(&self, s: &CStr16, pattern: &CStr16) -> bool
Performs a case insensitive comparison between a null terminated pattern string and a null terminated string.
This function checks if character pattern described in pattern
is found in string
. If the pattern match succeeds, true is returned.
Otherwise, false is returned.
The following syntax can be used to build the string pattern
:
Pattern Character | Meaning |
---|---|
* | Match 0 or more characters |
? | Match any one character |
[char1 char2 …charN ] | Match any character in the set |
[char1 -char2 ] | Match any character between char1 and char2 |
char | Match the character char |
For example, the pattern “.Fw” will match all strings that end in “.FW”, “.fw”, “.Fw” or “.fW”. The pattern “[a-z]” will match any letter in the alphabet. The pattern “z” will match the letter “z”. The pattern “d?.” will match the character “D” or “d” followed by any single character followed by a “.” followed by any string.
sourcepub fn str_lwr<'a>(
&self,
s: &CStr16,
buf: &'a mut [u16]
) -> Result<&'a CStr16, StrConversionError>
pub fn str_lwr<'a>( &self, s: &CStr16, buf: &'a mut [u16] ) -> Result<&'a CStr16, StrConversionError>
Converts the characters in s
to lower case characters.
sourcepub fn str_upr<'a>(
&self,
s: &CStr16,
buf: &'a mut [u16]
) -> Result<&'a CStr16, StrConversionError>
pub fn str_upr<'a>( &self, s: &CStr16, buf: &'a mut [u16] ) -> Result<&'a CStr16, StrConversionError>
Converts the characters in s
to upper case characters.
sourcepub fn fat_to_str<'a>(
&self,
fat: &CStr8,
buf: &'a mut [u16]
) -> Result<&'a CStr16, StrConversionError>
pub fn fat_to_str<'a>( &self, fat: &CStr8, buf: &'a mut [u16] ) -> Result<&'a CStr16, StrConversionError>
Converts the 8.3 FAT file name fat
to a null terminated string.
sourcepub fn str_to_fat<'a>(
&self,
s: &CStr16,
buf: &'a mut [u8]
) -> Result<&'a CStr8, StrConversionError>
pub fn str_to_fat<'a>( &self, s: &CStr16, buf: &'a mut [u8] ) -> Result<&'a CStr8, StrConversionError>
Converts the null terminated string s
to legal characters in a FAT file name.