diff options
| author | jduncanator <1518948+jduncanator@users.noreply.github.com> | 2018-11-29 13:01:19 +1100 |
|---|---|---|
| committer | gdkchan <gab.dark.100@gmail.com> | 2018-11-29 00:01:19 -0200 |
| commit | 9b22e8af5ee3e0896fc5f464022579ef0713e504 (patch) | |
| tree | a80e584b75091eae7e839fdbe3548adf6b0a948c /Ryujinx.HLE/Loaders/Npdm/ServiceAccessControl.cs | |
| parent | 59964f667c38d9d0550a3b5ef3970433493f4991 (diff) | |
Normalize all the line endings (#518)
Diffstat (limited to 'Ryujinx.HLE/Loaders/Npdm/ServiceAccessControl.cs')
| -rw-r--r-- | Ryujinx.HLE/Loaders/Npdm/ServiceAccessControl.cs | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/Ryujinx.HLE/Loaders/Npdm/ServiceAccessControl.cs b/Ryujinx.HLE/Loaders/Npdm/ServiceAccessControl.cs index b18538e5..707be603 100644 --- a/Ryujinx.HLE/Loaders/Npdm/ServiceAccessControl.cs +++ b/Ryujinx.HLE/Loaders/Npdm/ServiceAccessControl.cs @@ -1,42 +1,42 @@ -using System.Collections.Generic;
-using System.Collections.ObjectModel;
-using System.IO;
-using System.Text;
-
-namespace Ryujinx.HLE.Loaders.Npdm
-{
- class ServiceAccessControl
- {
- public IReadOnlyDictionary<string, bool> Services { get; private set; }
-
- public ServiceAccessControl(Stream Stream, int Offset, int Size)
- {
- Stream.Seek(Offset, SeekOrigin.Begin);
-
- BinaryReader Reader = new BinaryReader(Stream);
-
- int ByteReaded = 0;
-
- Dictionary<string, bool> Services = new Dictionary<string, bool>();
-
- while (ByteReaded != Size)
- {
- byte ControlByte = Reader.ReadByte();
-
- if (ControlByte == 0)
- {
- break;
- }
-
- int Length = (ControlByte & 0x07) + 1;
- bool RegisterAllowed = (ControlByte & 0x80) != 0;
-
- Services.Add(Encoding.ASCII.GetString(Reader.ReadBytes(Length), 0, Length), RegisterAllowed);
-
- ByteReaded += Length + 1;
- }
-
- this.Services = new ReadOnlyDictionary<string, bool>(Services);
- }
- }
-}
+using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.IO; +using System.Text; + +namespace Ryujinx.HLE.Loaders.Npdm +{ + class ServiceAccessControl + { + public IReadOnlyDictionary<string, bool> Services { get; private set; } + + public ServiceAccessControl(Stream Stream, int Offset, int Size) + { + Stream.Seek(Offset, SeekOrigin.Begin); + + BinaryReader Reader = new BinaryReader(Stream); + + int ByteReaded = 0; + + Dictionary<string, bool> Services = new Dictionary<string, bool>(); + + while (ByteReaded != Size) + { + byte ControlByte = Reader.ReadByte(); + + if (ControlByte == 0) + { + break; + } + + int Length = (ControlByte & 0x07) + 1; + bool RegisterAllowed = (ControlByte & 0x80) != 0; + + Services.Add(Encoding.ASCII.GetString(Reader.ReadBytes(Length), 0, Length), RegisterAllowed); + + ByteReaded += Length + 1; + } + + this.Services = new ReadOnlyDictionary<string, bool>(Services); + } + } +} |
