[Add] process typedef of new struct

This commit is contained in:
vn.py 2019-08-26 23:18:12 +08:00
parent 374bb478df
commit 27b646a12b
3 changed files with 20 additions and 1 deletions

View File

@ -155,6 +155,8 @@ CFutureReqOrderModifyField = {
"ErrorDescription": "string",
}
CFutureRspOrderInsertField = CFutureRspOrderModifyField
CFutureReqOrderCancelField = {
"UserId": "string",
"UserType": "string",
@ -597,6 +599,10 @@ CFutureRtnCapitalField = {
"SellNeedAddMargin": "double",
}
CFutureRtnOrderField = CFutureRtnPositionField
CFutureRspTradeField = CFutureRtnTradeField
CFutureReqGetQuestionField = {
"Unused": "int",
"ErrorDescription": "string",
@ -650,6 +656,8 @@ CFutureQryTotalPositionField = {
"ErrorDescription": "string",
}
CFutureRtnOrderField = CFutureRspTotalPositionField
CFutureQryStrategyField = {
"ExchangeNo": "string",
"ErrorDescription": "string",

View File

@ -155,6 +155,8 @@ CStockReqOrderModifyField = {
"ErrorDescription": "string",
}
CStockRspOrderInsertField = CStockRspOrderModifyField
CStockReqOrderCancelField = {
"UserId": "string",
"UserType": "string",
@ -554,6 +556,10 @@ CStockRtnCapitalField = {
"SellNeedAddMargin": "double",
}
CStockRspPositionField = CStockRtnPositionField
CStockRspTradeField = CStockRtnTradeField
CStockReqGetQuestionField = {
"Unused": "int",
"ErrorDescription": "string",

View File

@ -54,7 +54,12 @@ class StructGenerator:
def process_typedef(self, line: str):
"""处理类型定义"""
print("typdef注意", line) # 一共三行,手动处理
line = line.replace("\t", " ")
words = line.split(" ")
name = words[1]
value = words[2]
new_line = f"{name} = {value}\n\n"
self.f_struct.write(new_line)
def process_declare(self, line: str):
"""处理声明"""