]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/Python/UPT/Library/StringUtils.py
BaseTools: Replace BSD License with BSD+Patent License
[mirror_edk2.git] / BaseTools / Source / Python / UPT / Library / StringUtils.py
index 90946337d089951b389b6dc3291cc3ea8beeab8c..e43924fa6c0111986e52945d9982e6da30b765f6 100644 (file)
@@ -4,13 +4,7 @@
 #\r
 # Copyright (c) 2011 - 2018, Intel Corporation. All rights reserved.<BR>\r
 #\r
-# This program and the accompanying materials are licensed and made available\r
-# under the terms and conditions of the BSD License which accompanies this\r
-# distribution. The full text of the license may be found at\r
-# http://opensource.org/licenses/bsd-license.php\r
-#\r
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+# SPDX-License-Identifier: BSD-2-Clause-Patent\r
 #\r
 '''\r
 StringUtils\r
@@ -33,7 +27,7 @@ gMACRO_PATTERN = re.compile("\$\(([_A-Z][_A-Z0-9]*)\)", re.UNICODE)
 \r
 ## GetSplitValueList\r
 #\r
-# Get a value list from a string with multiple values splited with SplitTag\r
+# Get a value list from a string with multiple values split with SplitTag\r
 # The default SplitTag is DataType.TAB_VALUE_SPLIT\r
 # 'AAA|BBB|CCC' -> ['AAA', 'BBB', 'CCC']\r
 #\r
@@ -67,7 +61,7 @@ def MergeArches(Dict, Key, Arch):
 # Return False if invalid format\r
 #\r
 # @param String:   String with DEFINE statement\r
-# @param Arch:     Supportted Arch\r
+# @param Arch:     Supported Arch\r
 # @param Defines:  DEFINE statement to be parsed\r
 #\r
 def GenDefines(String, Arch, Defines):\r
@@ -236,7 +230,7 @@ def ReplaceMacro(String, MacroDefinitions=None, SelfReplacement=False, Line=None
 ## NormPath\r
 #\r
 # Create a normal path\r
-# And replace DFEINE in the path\r
+# And replace DEFINE in the path\r
 #\r
 # @param Path:     The input value for Path to be converted\r
 # @param Defines:  A set for DEFINE statement\r
@@ -613,9 +607,9 @@ def WorkspaceFile(WorkspaceDir, Filename):
 \r
 ## Split string\r
 #\r
-# Revmove '"' which startswith and endswith string\r
+# Remove '"' which startswith and endswith string\r
 #\r
-# @param String:  The string need to be splited\r
+# @param String:  The string need to be split\r
 #\r
 def SplitString(String):\r
     if String.startswith('\"'):\r
@@ -679,9 +673,7 @@ def GetHelpTextList(HelpTextClassList):
 # @param String: the source string\r
 #\r
 def StringArrayLength(String):\r
-    if isinstance(String, unicode):\r
-        return (len(String) + 1) * 2 + 1\r
-    elif String.startswith('L"'):\r
+    if String.startswith('L"'):\r
         return (len(String) - 3 + 1) * 2\r
     elif String.startswith('"'):\r
         return (len(String) - 2 + 1)\r
@@ -736,7 +728,7 @@ def IsHexDigit(Str):
                 return False\r
     return False\r
 \r
-## Check if the string is HexDgit and its interger value within limit of UINT32\r
+## Check if the string is HexDgit and its integer value within limit of UINT32\r
 #\r
 # Return true if all characters in the string are digits and there is at\r
 # least one character\r