From 135b09a2c26d9c28f02c4d356a62ca8817344e15 Mon Sep 17 00:00:00 2001 From: Olivier Martin Date: Fri, 11 Apr 2014 10:59:48 +0000 Subject: ArmPlatformPkg/Bds: Introduced helper function to detect if an Ascii/Unicode string is printable Some limitations: - it only supports unicode string that use ASCII character (< 0x100) - single character ASCII strings are interpreted as Unicode string - string cannot be longer than 2 x BOOT_DEVICE_OPTION_MAX (600 bytes) Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Olivier Martin git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15455 6f19259b-4bc3-4df7-8a09-765794883524 --- ArmPlatformPkg/Bds/BdsInternal.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'ArmPlatformPkg/Bds/BdsInternal.h') diff --git a/ArmPlatformPkg/Bds/BdsInternal.h b/ArmPlatformPkg/Bds/BdsInternal.h index da7b8ca704..447b8c9cd1 100644 --- a/ArmPlatformPkg/Bds/BdsInternal.h +++ b/ArmPlatformPkg/Bds/BdsInternal.h @@ -257,4 +257,25 @@ IsUnicodeString ( IN VOID* String ); +/* + * Try to detect if the given string is an ASCII or Unicode string + * + * There are actually few limitation to this function but it is mainly to give + * a user friendly output. + * + * Some limitations: + * - it only supports unicode string that use ASCII character (< 0x100) + * - single character ASCII strings are interpreted as Unicode string + * - string cannot be longer than 2 x BOOT_DEVICE_OPTION_MAX (600 bytes) + * + * @param String Buffer that might contain a Unicode or Ascii string + * @param IsUnicode If not NULL this boolean value returns if the string is an + * ASCII or Unicode string. + */ +BOOLEAN +IsPrintableString ( + IN VOID* String, + OUT BOOLEAN *IsUnicode + ); + #endif /* _BDSINTERNAL_H_ */ -- cgit v1.2.3