|
1 | | -// Copyright (c) 2018 SIL Global |
| 1 | +// Copyright (c) 2018-2025 SIL Global |
2 | 2 | // This software is licensed under the MIT License (http://opensource.org/licenses/MIT) |
3 | 3 | using System; |
4 | 4 | using System.Collections.Generic; |
5 | | -using System.Diagnostics.CodeAnalysis; |
6 | 5 | using System.IO; |
7 | 6 | using System.Text.RegularExpressions; |
8 | 7 | using System.Xml; |
| 8 | +using JetBrains.Annotations; |
9 | 9 | using Microsoft.Build.Framework; |
10 | 10 | using Microsoft.Build.Utilities; |
11 | 11 |
|
12 | 12 | namespace SIL.BuildTasks.MakePot |
13 | 13 | { |
14 | | - [SuppressMessage("ReSharper", "MemberCanBePrivate.Global")] |
15 | | - [SuppressMessage("ReSharper", "UnusedAutoPropertyAccessor.Global")] |
| 14 | + [PublicAPI] |
16 | 15 | public class MakePot: Task |
17 | 16 | { |
18 | 17 | private readonly Dictionary<string, List<string>> _entries = new Dictionary<string, List<string>>(); |
@@ -182,7 +181,7 @@ internal void ProcessSrcFile(string filePath) |
182 | 181 | } |
183 | 182 | var comments = "#: " + filePath; |
184 | 183 |
|
185 | | - //catch the second parameter from calls like this: |
| 184 | + // Catch the second parameter from calls like this: |
186 | 185 | // StringCataGet("~Note", "The label for the field showing a note."); |
187 | 186 |
|
188 | 187 | if (!string.IsNullOrEmpty(match.Groups["note"].Value)) |
@@ -214,16 +213,16 @@ private static void WriteEntry(string key, IEnumerable<string> comments, TextWri |
214 | 213 |
|
215 | 214 | public static string EscapeString(string s) |
216 | 215 | { |
217 | | - var result = s.Replace("\\", "\\\\"); // This must be first |
| 216 | + var result = s.Replace(@"\", @"\\"); // This must be first |
218 | 217 | result = result.Replace("\"", "\\\""); |
219 | 218 | return result; |
220 | 219 | } |
221 | 220 |
|
222 | 221 | public static string UnescapeString(string s) |
223 | 222 | { |
224 | | - var result = s.Replace("\\'", "'"); |
225 | | - result = result.Replace("\\\"", "\""); |
226 | | - result = result.Replace("\\\\", "\\"); |
| 223 | + var result = s.Replace(@"\'", "'"); |
| 224 | + result = result.Replace(@"\""", "\""); |
| 225 | + result = result.Replace(@"\\", @"\"); |
227 | 226 | return result; |
228 | 227 | } |
229 | 228 | } |
|
0 commit comments