This repository was archived by the owner on Feb 28, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathDataEntry.cs
67 lines (62 loc) · 2.12 KB
/
DataEntry.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
// Automatically generated by xdrgen
// DO NOT EDIT or your changes may be overwritten
namespace Stellar.Generated
{
// === xdr source ============================================================
// struct DataEntry
// {
// AccountID accountID; // account this data belongs to
// string64 dataName;
// DataValue dataValue;
//
// // reserved for future use
// union switch (int v)
// {
// case 0:
// void;
// }
// ext;
// };
// ===========================================================================
public class DataEntry {
public DataEntry () {}
public AccountID AccountID { get; set; }
public String64 DataName { get; set; }
public DataValue DataValue { get; set; }
public DataEntryExt Ext { get; set; }
public static void Encode(IByteWriter stream, DataEntry encodedDataEntry) {
AccountID.Encode(stream, encodedDataEntry.AccountID);
String64.Encode(stream, encodedDataEntry.DataName);
DataValue.Encode(stream, encodedDataEntry.DataValue);
DataEntryExt.Encode(stream, encodedDataEntry.Ext);
}
public static DataEntry Decode(IByteReader stream) {
DataEntry decodedDataEntry = new DataEntry();
decodedDataEntry.AccountID = AccountID.Decode(stream);
decodedDataEntry.DataName = String64.Decode(stream);
decodedDataEntry.DataValue = DataValue.Decode(stream);
decodedDataEntry.Ext = DataEntryExt.Decode(stream);
return decodedDataEntry;
}
public class DataEntryExt {
public DataEntryExt () {}
public int Discriminant { get; set; } = new int();
public static void Encode(IByteWriter stream, DataEntryExt encodedDataEntryExt) {
XdrEncoding.EncodeInt32(encodedDataEntryExt.Discriminant, stream);
switch (encodedDataEntryExt.Discriminant) {
case 0:
break;
}
}
public static DataEntryExt Decode(IByteReader stream) {
DataEntryExt decodedDataEntryExt = new DataEntryExt();
decodedDataEntryExt.Discriminant = XdrEncoding.DecodeInt32(stream);
switch (decodedDataEntryExt.Discriminant) {
case 0:
break;
}
return decodedDataEntryExt;
}
}
}
}