diff options
| author | Thog <me@thog.eu> | 2020-05-15 03:56:14 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-15 03:56:14 +0200 |
| commit | 0ff00bd6d35390eb132eecd3ba307ba4bbfdd56d (patch) | |
| tree | bee57b671535e00762fe23d40cda454466876b86 /Ryujinx.HLE/HOS/Applets/Browser/BrowserOutput.cs | |
| parent | 378259a40a938cad6a53b7d2910bb1d2d0fdb58a (diff) | |
am: Implement common web applets (#1188)
* am: Implemnet common web applets
This implement parsing of input and output of web applets while making
those close directly.
TODO for the future: Use and hook a web browser.
* Address Ac_K's comments
Diffstat (limited to 'Ryujinx.HLE/HOS/Applets/Browser/BrowserOutput.cs')
| -rw-r--r-- | Ryujinx.HLE/HOS/Applets/Browser/BrowserOutput.cs | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/Ryujinx.HLE/HOS/Applets/Browser/BrowserOutput.cs b/Ryujinx.HLE/HOS/Applets/Browser/BrowserOutput.cs new file mode 100644 index 00000000..0b368262 --- /dev/null +++ b/Ryujinx.HLE/HOS/Applets/Browser/BrowserOutput.cs @@ -0,0 +1,47 @@ +using Ryujinx.Common; +using System; +using System.IO; + +namespace Ryujinx.HLE.HOS.Applets.Browser +{ + class BrowserOutput + { + public BrowserOutputType Type { get; } + public byte[] Value { get; } + + public BrowserOutput(BrowserOutputType type, byte[] value) + { + Type = type; + Value = value; + } + + public BrowserOutput(BrowserOutputType type, uint value) + { + Type = type; + Value = BitConverter.GetBytes(value); + } + + public BrowserOutput(BrowserOutputType type, ulong value) + { + Type = type; + Value = BitConverter.GetBytes(value); + } + + public BrowserOutput(BrowserOutputType type, bool value) + { + Type = type; + Value = BitConverter.GetBytes(value); + } + + public void Write(BinaryWriter writer) + { + writer.WriteStruct(new WebArgTLV + { + Type = (ushort)Type, + Size = (ushort)Value.Length + }); + + writer.Write(Value); + } + } +} |
