History

Added more code to GSF shared code project - moved PathHelper path validation function into FilePath

J. Ritchie Carroll committed 10 years ago

Commit e16ec441 parent 612a09672 files · +1523 −1481Browse files

Showing the changes to Source/Libraries/GSF.Core/ByteEncoding.cs (1 of 72 files). Show all

Unified · Split

Source/Libraries/GSF.Core/ByteEncoding.cs+13−13
@@ -121,10 +121,10 @@ namespace GSF · 120 unmodified lines
121121 return bytes;
122122 }
123123
124− throw new ArgumentException("Input string is not a valid hex encoded string - invalid characters encountered", "hexData");
124+ throw new ArgumentException("Input string is not a valid hex encoded string - invalid characters encountered", nameof(hexData));
125125 }
126126
127− throw new ArgumentNullException("hexData", "Input string cannot be null or empty");
127+ throw new ArgumentNullException(nameof(hexData), "Input string cannot be null or empty");
128128 }
129129
130130 /// <summary>Encodes given buffer into a user presentable representation.</summary>
@@ -187,10 +187,10 @@ namespace GSF · 56 unmodified lines
187187 return bytes;
188188 }
189189
190− throw new ArgumentException("Input string is not a valid decimal encoded string - invalid characters encountered", "decData");
190+ throw new ArgumentException("Input string is not a valid decimal encoded string - invalid characters encountered", nameof(decData));
191191 }
192192
193− throw new ArgumentNullException("decData", "Input string cannot be null or empty");
193+ throw new ArgumentNullException(nameof(decData), "Input string cannot be null or empty");
194194 }
195195
196196 /// <summary>Encodes given buffer into a user presentable representation.</summary>
@@ -322,10 +322,10 @@ namespace GSF · 125 unmodified lines
322322 return bytes;
323323 }
324324
325− throw new ArgumentException("Input string is not a valid binary encoded string - invalid characters encountered", "binaryData");
325+ throw new ArgumentException("Input string is not a valid binary encoded string - invalid characters encountered", nameof(binaryData));
326326 }
327327
328− throw new ArgumentNullException("binaryData", "Input string cannot be null or empty");
328+ throw new ArgumentNullException(nameof(binaryData), "Input string cannot be null or empty");
329329 }
330330
331331 /// <summary>Encodes given buffer into a user presentable representation.</summary>
@@ -337,7 +337,7 @@ namespace GSF · 5 unmodified lines
337337 public override string GetString(byte[] bytes, int offset, int length, char spacingCharacter)
338338 {
339339 if ((object)bytes == null)
340− throw new ArgumentNullException("bytes", "Input buffer cannot be null");
340+ throw new ArgumentNullException(nameof(bytes), "Input buffer cannot be null");
341341
342342 // Initializes byte image array on first call for speed in future calls.
343343 if ((object)m_byteImages == null)
@@ -475,7 +475,7 @@ namespace GSF · 131 unmodified lines
475475 public override string GetString(byte[] bytes, int offset, int length, char spacingCharacter)
476476 {
477477 if ((object)bytes == null)
478− throw new ArgumentNullException("bytes", "Input buffer cannot be null");
478+ throw new ArgumentNullException(nameof(bytes), "Input buffer cannot be null");
479479
480480 string base64String = Convert.ToBase64String(bytes, offset, length);
481481
@@ -532,7 +532,7 @@ namespace GSF · 50 unmodified lines
532532 public override string GetString(byte[] bytes, int offset, int length, char spacingCharacter)
533533 {
534534 if ((object)bytes == null)
535− throw new ArgumentNullException("bytes", "Input buffer cannot be null");
535+ throw new ArgumentNullException(nameof(bytes), "Input buffer cannot be null");
536536
537537 string asciiString = Encoding.ASCII.GetString(bytes, offset, length);
538538
@@ -578,7 +578,7 @@ namespace GSF · 39 unmodified lines
578578 public virtual string GetString(byte[] bytes, char spacingCharacter)
579579 {
580580 if ((object)bytes == null)
581− throw new ArgumentNullException("bytes", "Input buffer cannot be null");
581+ throw new ArgumentNullException(nameof(bytes), "Input buffer cannot be null");
582582
583583 return GetString(bytes, 0, bytes.Length, spacingCharacter);
584584 }
@@ -591,7 +591,7 @@ namespace GSF · 6 unmodified lines
591591 public virtual string GetString(byte[] bytes, int offset, int length)
592592 {
593593 if ((object)bytes == null)
594− throw new ArgumentNullException("bytes", "Input buffer cannot be null");
594+ throw new ArgumentNullException(nameof(bytes), "Input buffer cannot be null");
595595
596596 return GetString(bytes, offset, length, NoSpacing);
597597 }
@@ -610,7 +610,7 @@ namespace GSF · 12 unmodified lines
610610 public virtual byte[] GetBytes(string value)
611611 {
612612 if (string.IsNullOrEmpty(value))
613− throw new ArgumentNullException("value", "Input string cannot be null");
613+ throw new ArgumentNullException(nameof(value), "Input string cannot be null");
614614 return GetBytes(value, NoSpacing);
615615 }
616616
@@ -726,7 +726,7 @@ namespace GSF · 109 unmodified lines
726726 internal static string BytesToString(byte[] bytes, int offset, int length, char spacingCharacter, string format)
727727 {
728728 if ((object)bytes == null)
729− throw new ArgumentNullException("bytes", "Input buffer cannot be null");
729+ throw new ArgumentNullException(nameof(bytes), "Input buffer cannot be null");
730730
731731 StringBuilder byteString = new StringBuilder();
732732

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t