From 3ccd5e439da4296d6f2b66ce47075ab20d039676 Mon Sep 17 00:00:00 2001 From: Rob Mensching Date: Sun, 14 Mar 2021 07:38:48 -0700 Subject: Minimize public surface area of Core Fixes wixtoolset/issues#6374 --- src/WixToolset.Core/CompilerCore.cs | 37 +++++++++++-------------------------- 1 file changed, 11 insertions(+), 26 deletions(-) (limited to 'src/WixToolset.Core/CompilerCore.cs') diff --git a/src/WixToolset.Core/CompilerCore.cs b/src/WixToolset.Core/CompilerCore.cs index cfe3082e..ec22a8ec 100644 --- a/src/WixToolset.Core/CompilerCore.cs +++ b/src/WixToolset.Core/CompilerCore.cs @@ -296,20 +296,6 @@ namespace WixToolset.Core return sb?.ToString() ?? filename; } - /// - /// Creates a short file/directory name using an identifier and long file/directory name as input. - /// - /// The long file/directory name. - /// The option to keep the extension on generated short names. - /// true if wildcards are allowed in the filename. - /// Any additional information to include in the hash for the generated short name. - /// The generated 8.3-compliant short file/directory name. - [Obsolete] - public string CreateShortName(string longName, bool keepExtension, bool allowWildcards, params string[] args) - { - return this.parseHelper.CreateShortName(longName, keepExtension, allowWildcards, args); - } - /// /// Verifies the given string is a valid product version. /// @@ -337,7 +323,7 @@ namespace WixToolset.Core /// True if version is a valid module or bundle version. public static bool IsValidModuleOrBundleVersion(string version) { - return Common.IsValidModuleOrBundleVersion(version); + return Common.IsValidFourPartVersion(version); } /// @@ -547,15 +533,14 @@ namespace WixToolset.Core { if (null == attribute) { - throw new ArgumentNullException("attribute"); + throw new ArgumentNullException(nameof(attribute)); } - string value = this.GetAttributeValue(sourceLineNumbers, attribute); + var value = this.GetAttributeValue(sourceLineNumbers, attribute); try { - int codePage = Common.GetValidCodePage(value); - return codePage; + return Common.GetValidCodePage(value); } catch (NotSupportedException) { @@ -576,12 +561,12 @@ namespace WixToolset.Core { if (null == attribute) { - throw new ArgumentNullException("attribute"); + throw new ArgumentNullException(nameof(attribute)); } - string value = this.GetAttributeValue(sourceLineNumbers, attribute); + var value = this.GetAttributeValue(sourceLineNumbers, attribute); - // allow for localization of code page names and values + // Allow for localization of code page names and values. if (this.IsValidLocIdentifier(value)) { return value; @@ -589,13 +574,13 @@ namespace WixToolset.Core try { - int codePage = Common.GetValidCodePage(value, false, onlyAnsi, sourceLineNumbers); + var codePage = Common.GetValidCodePage(value, false, onlyAnsi, sourceLineNumbers); return codePage.ToString(CultureInfo.InvariantCulture); } catch (NotSupportedException) { - // not a valid windows code page - this.Write(ErrorMessages.IllegalCodepageAttribute(sourceLineNumbers, value, attribute.Parent.Name.LocalName, attribute.Name.LocalName)); + // Not a valid windows code page. + this.messaging.Write(ErrorMessages.IllegalCodepageAttribute(sourceLineNumbers, value, attribute.Parent.Name.LocalName, attribute.Name.LocalName)); } catch (WixException e) { @@ -805,7 +790,7 @@ namespace WixToolset.Core if (0 < value.Length) { - if (!this.IsValidShortFilename(value, allowWildcards) && !Common.ContainsValidBinderVariable(value)) + if (!this.parseHelper.IsValidShortFilename(value, allowWildcards) && !Common.ContainsValidBinderVariable(value)) { this.Write(ErrorMessages.IllegalShortFilename(sourceLineNumbers, attribute.Parent.Name.LocalName, attribute.Name.LocalName, value)); } -- cgit v1.2.3-55-g6feb