2016-07-16 13:37:56 +00:00
|
|
|
using System;
|
|
|
|
|
|
|
|
namespace Kaitai
|
|
|
|
{
|
2016-07-17 01:54:59 +00:00
|
|
|
public abstract class KaitaiStruct
|
2016-07-16 13:37:56 +00:00
|
|
|
{
|
2016-07-18 11:11:58 +00:00
|
|
|
protected KaitaiStream m_io;
|
2016-07-16 13:37:56 +00:00
|
|
|
|
2016-07-18 11:11:58 +00:00
|
|
|
public KaitaiStream M_Io
|
2016-07-16 13:37:56 +00:00
|
|
|
{
|
2016-07-18 11:11:58 +00:00
|
|
|
get
|
|
|
|
{
|
|
|
|
return m_io;
|
|
|
|
}
|
2016-07-16 13:37:56 +00:00
|
|
|
}
|
|
|
|
|
2016-07-18 11:11:58 +00:00
|
|
|
public KaitaiStruct(KaitaiStream io)
|
2016-07-17 01:54:59 +00:00
|
|
|
{
|
2016-07-18 11:11:58 +00:00
|
|
|
m_io = io;
|
2016-07-17 01:54:59 +00:00
|
|
|
}
|
2016-07-16 13:37:56 +00:00
|
|
|
}
|
2017-09-06 18:10:59 +00:00
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// A custom decoder interface. Implementing classes can be called from
|
|
|
|
/// inside a .ksy file using `process: XXX` syntax.
|
|
|
|
/// </summary>
|
|
|
|
public interface CustomDecoder
|
|
|
|
{
|
|
|
|
/// <summary>
|
|
|
|
/// Decodes a given byte array, according to some custom algorithm
|
|
|
|
/// (specific to implementing class) and parameters given in the
|
|
|
|
/// constructor, returning another byte array.
|
|
|
|
/// </summary>
|
|
|
|
/// <param name="src">Source byte array.</param>
|
|
|
|
byte[] Decode(byte[] src);
|
|
|
|
}
|
|
|
|
}
|