public string getListEncode(ProtocolMemberType memberType, string paramType, string member, string structClassName = "structClassName") { var arrayMember = template_listAccess.Replace(mark_member, member); var encode = getEncode(memberType, paramType, arrayMember, structClassName); var result = template_listEncode.Replace("$(encode)", encode.Trim()); result = result.Replace(mark_member, member); result = result.Replace(mark_className, structClassName); return result; }
private ParamVO getParamVO(string paramType, ProtocolMemberType memberType = ProtocolMemberType.Normal) { paramType = paramType.ToLower(); switch (memberType) { case ProtocolMemberType.Normal: return dic_param[paramType]; case ProtocolMemberType.Struct: return dic_param["struct"]; case ProtocolMemberType.Enum: return dic_param["enum"]; } //throw new Exception("不支持的paramType:" + paramType); return null; }
public string getEncode(ProtocolMemberType memberType, string paramType, string member, string structClassName = "structClassName") { var paramVO = getParamVO(paramType, memberType); var result = paramVO.template_encode.Replace(mark_member, member); result = result.Replace(mark_className, structClassName); return result; }