From ef50c60f00fbfebc1d4bb1eba2b44d2b7389d3eb Mon Sep 17 00:00:00 2001 From: triton Date: Wed, 6 Mar 2013 03:56:01 +0000 Subject: [PATCH] Moved the SplitCamelCase method to the utils. --- src/Generator/Passes/FunctionToStaticMethodPass.cs | 9 +-------- src/Generator/Utils/Utils.cs | 6 ++++++ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/Generator/Passes/FunctionToStaticMethodPass.cs b/src/Generator/Passes/FunctionToStaticMethodPass.cs index db0b663c..86ec8018 100644 --- a/src/Generator/Passes/FunctionToStaticMethodPass.cs +++ b/src/Generator/Passes/FunctionToStaticMethodPass.cs @@ -1,5 +1,4 @@ using System; -using System.Diagnostics; using System.Text.RegularExpressions; namespace Cxxi.Passes @@ -18,7 +17,7 @@ namespace Cxxi.Passes if (function.Ignore) return false; - var types = SplitCamelCase(function.Name); + var types = StringHelpers.SplitCamelCase(function.Name); if (types.Length == 0) return false; @@ -54,12 +53,6 @@ namespace Cxxi.Passes return true; } - - public static string[] SplitCamelCase(string input) - { - var str = Regex.Replace(input, "([A-Z])", " $1", RegexOptions.Compiled); - return str.Trim().Split(); - } } public static class FunctionToStaticMethodExtensions diff --git a/src/Generator/Utils/Utils.cs b/src/Generator/Utils/Utils.cs index c5f1bee0..0d6c8c6e 100644 --- a/src/Generator/Utils/Utils.cs +++ b/src/Generator/Utils/Utils.cs @@ -158,6 +158,12 @@ namespace Cxxi debugText = Regex.Replace(debugText, " ( )+", " "); debugText = Regex.Replace(debugText, "\n", ""); } + + public static string[] SplitCamelCase(string input) + { + var str = Regex.Replace(input, "([A-Z])", " $1", RegexOptions.Compiled); + return str.Trim().Split(); + } } public static class AssemblyHelpers