Example #1
0
        public static LedgerEntryChange Decode(XdrDataInputStream stream)
        {
            LedgerEntryChange     decodedLedgerEntryChange = new LedgerEntryChange();
            LedgerEntryChangeType discriminant             = LedgerEntryChangeType.Decode(stream);

            decodedLedgerEntryChange.Discriminant = discriminant;
            switch (decodedLedgerEntryChange.Discriminant.InnerValue)
            {
            case LedgerEntryChangeType.LedgerEntryChangeTypeEnum.LEDGER_ENTRY_CREATED:
                decodedLedgerEntryChange.Created = LedgerEntry.Decode(stream);
                break;

            case LedgerEntryChangeType.LedgerEntryChangeTypeEnum.LEDGER_ENTRY_UPDATED:
                decodedLedgerEntryChange.Updated = LedgerEntry.Decode(stream);
                break;

            case LedgerEntryChangeType.LedgerEntryChangeTypeEnum.LEDGER_ENTRY_REMOVED:
                decodedLedgerEntryChange.Removed = LedgerKey.Decode(stream);
                break;

            case LedgerEntryChangeType.LedgerEntryChangeTypeEnum.LEDGER_ENTRY_STATE:
                decodedLedgerEntryChange.State = LedgerEntry.Decode(stream);
                break;
            }
            return(decodedLedgerEntryChange);
        }
Example #2
0
        public static void Encode(XdrDataOutputStream stream, LedgerEntryChanges encodedLedgerEntryChanges)
        {
            int LedgerEntryChangessize = encodedLedgerEntryChanges.InnerValue.Length;

            stream.WriteInt(LedgerEntryChangessize);
            for (int i = 0; i < LedgerEntryChangessize; i++)
            {
                LedgerEntryChange.Encode(stream, encodedLedgerEntryChanges.InnerValue[i]);
            }
        }
Example #3
0
        public static LedgerEntryChanges Decode(XdrDataInputStream stream)
        {
            LedgerEntryChanges decodedLedgerEntryChanges = new LedgerEntryChanges();
            int LedgerEntryChangessize = stream.ReadInt();

            decodedLedgerEntryChanges.InnerValue = new LedgerEntryChange[LedgerEntryChangessize];
            for (int i = 0; i < LedgerEntryChangessize; i++)
            {
                decodedLedgerEntryChanges.InnerValue[i] = LedgerEntryChange.Decode(stream);
            }
            return(decodedLedgerEntryChanges);
        }
Example #4
0
        public static void Encode(XdrDataOutputStream stream, LedgerEntryChange encodedLedgerEntryChange)
        {
            stream.WriteInt((int)encodedLedgerEntryChange.Discriminant.InnerValue);
            switch (encodedLedgerEntryChange.Discriminant.InnerValue)
            {
            case LedgerEntryChangeType.LedgerEntryChangeTypeEnum.LEDGER_ENTRY_CREATED:
                LedgerEntry.Encode(stream, encodedLedgerEntryChange.Created);
                break;

            case LedgerEntryChangeType.LedgerEntryChangeTypeEnum.LEDGER_ENTRY_UPDATED:
                LedgerEntry.Encode(stream, encodedLedgerEntryChange.Updated);
                break;

            case LedgerEntryChangeType.LedgerEntryChangeTypeEnum.LEDGER_ENTRY_REMOVED:
                LedgerKey.Encode(stream, encodedLedgerEntryChange.Removed);
                break;

            case LedgerEntryChangeType.LedgerEntryChangeTypeEnum.LEDGER_ENTRY_STATE:
                LedgerEntry.Encode(stream, encodedLedgerEntryChange.State);
                break;
            }
        }