3 Copyright (c) 2007 - 2008, Intel Corporation
4 All rights reserved. This program and the accompanying materials
5 are licensed and made available under the terms and conditions of the BSD License
6 which accompanies this distribution. The full text of the license may be found at
7 http://opensource.org/licenses/bsd-license.php
9 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
10 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
18 String routines implementation.
22 #ifndef _EFI_STRING_FUNCS_H
23 #define _EFI_STRING_FUNCS_H
27 #include <Common/UefiBaseTypes.h>
30 // Common data structures
35 // Actually this array can be 0 or more items (based on Count)
42 // Functions declarations
54 Allocates a new string and copies 'String' to clone it
58 String The string to clone
62 CHAR8* - NULL if there are not enough resources
68 StripInfDscStringInPlace (
76 Remove all comments, leading and trailing whitespace from the string.
80 Strin The string to 'strip'
90 SplitStringByWhitespace (
98 Creates and returns a 'split' STRING_LIST by splitting the string
99 on whitespace boundaries.
103 String The string to 'split'
120 Creates a new STRING_LIST with 0 strings.
124 STRING_LIST* - Null if there is not enough resources to create the object.
130 AppendCopyOfStringToList (
131 IN OUT STRING_LIST
**StringList
,
139 Adds String to StringList. A new copy of String is made before it is
150 RemoveLastStringFromList (
151 IN STRING_LIST
*StringList
158 Removes the last string from StringList and frees the memory associated
163 StringList The string list to remove the string from
173 AllocateStringListStruct (
181 Allocates a STRING_LIST structure that can store StringCount strings.
185 StringCount The number of strings that need to be stored
196 IN STRING_LIST
*StringList
203 Frees all memory associated with StringList.
207 StringList The string list to free
218 IN STRING_LIST
*StringList
225 Generates a string that represents the STRING_LIST
229 StringList The string list to convert to a string
233 CHAR8* - The string list represented with a single string. The returned
234 string must be freed by the caller.
241 IN STRING_LIST
*StringList
248 Prints out the string list
252 StringList The string list to print