public static TdrError.ErrorType printWString(ref TdrVisualBuf buf, int indent, char sep, string variable, int arrIdx, Int16[] str) { TdrError.ErrorType ret = TdrError.ErrorType.TDR_NO_ERROR; //int count = TdrTypeUtil.wstrlen(str) + 1; ret = buf.sprintf("{0}[{1:d}]", variable, arrIdx); if (ret == TdrError.ErrorType.TDR_NO_ERROR) { int len = TdrTypeUtil.wstrlen(str); for (int i = 0; i < len; i++) { ret = buf.sprintf("0x{0:X4}", str[i]); if (TdrError.ErrorType.TDR_NO_ERROR != ret) { break; } } } if (TdrError.ErrorType.TDR_NO_ERROR == ret) { ret = buf.sprintf("{0}", sep); } return(ret); }
public TdrError.ErrorType visualize(ref TdrVisualBuf destBuf, int indent, char separator) { TdrError.ErrorType type = TdrError.ErrorType.TDR_NO_ERROR; object[] args = new object[] { this.dwDataLen }; type = TdrBufUtil.printVariable(ref destBuf, indent, separator, "[dwDataLen]", "{0:d}", args); if (type == TdrError.ErrorType.TDR_NO_ERROR) { if (0x100000 < this.dwDataLen) { return(TdrError.ErrorType.TDR_ERR_REFER_SURPASS_COUNT); } type = TdrBufUtil.printArray(ref destBuf, indent, separator, "[szData]", (long)this.dwDataLen); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } for (int i = 0; i < this.dwDataLen; i++) { object[] objArray2 = new object[] { this.szData[i] }; type = destBuf.sprintf("0x{0:x2}", objArray2); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } } object[] objArray3 = new object[] { separator }; type = destBuf.sprintf("{0}", objArray3); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } } return(type); }
/* set indent = -1 to disable indent , default: separator = '\n' */ public TdrError.ErrorType visualize(ref TdrVisualBuf destBuf, int indent, char separator) { TdrError.ErrorType ret = TdrError.ErrorType.TDR_NO_ERROR; /* visualize member: this.iId */ ret = TdrBufUtil.printVariable(ref destBuf, indent, separator, "[iId]", "{0:d}", this.iId); if (TdrError.ErrorType.TDR_NO_ERROR != ret) { #if (DEBUG) TdrDebug.tdrTrace(); #endif return(ret); } /* visualize member: this.iCount */ ret = TdrBufUtil.printVariable(ref destBuf, indent, separator, "[iCount]", "{0:d}", this.iCount); if (TdrError.ErrorType.TDR_NO_ERROR != ret) { #if (DEBUG) TdrDebug.tdrTrace(); #endif return(ret); } return(ret); }
public static TdrError.ErrorType tdrDateTime2Str(ref TdrVisualBuf buf, UInt64 datetime) { TdrError.ErrorType ret = TdrError.ErrorType.TDR_NO_ERROR; TdrDateTime tdrDateTime = new TdrDateTime(); ret = tdrDateTime.parse(datetime); if (TdrError.ErrorType.TDR_NO_ERROR == ret) { ret = buf.sprintf("{0:d4}-{1:d2}-{2:d2} {3:d2}:{4:d2}:{5:d2}", tdrDateTime.tdrDate.nYear, tdrDateTime.tdrDate.bMon, tdrDateTime.tdrDate.bDay, tdrDateTime.tdrTime.nHour, tdrDateTime.tdrTime.bMin, tdrDateTime.tdrTime.bSec); } else { #if (DEBUG) StackTrace st = new StackTrace(true); for (int i = 0; i < st.FrameCount; i++) { if (null != st.GetFrame(i).GetFileName()) { Console.WriteLine(st.GetFrame(i).ToString()); } } #endif ret = TdrError.ErrorType.TDR_ERR_INVALID_TDRDATETIME_VALUE; } return(ret); }
public TdrError.ErrorType visualize(ref TdrVisualBuf destBuf, int indent, char separator) { #if (DEBUG) TdrDebug.tdrTrace(); #endif return(TdrError.ErrorType.TDR_ERR_METHOD_NOT_IMPLEMENTED); }
public TdrError.ErrorType visualize(ref string buffer, int indent, char separator) { TdrVisualBuf destBuf = new TdrVisualBuf(); TdrError.ErrorType type = this.visualize(ref destBuf, indent, separator); buffer = destBuf.getVisualBuf(); return(type); }
public TdrError.ErrorType visualize(ref string buffer, int indent, char separator) { TdrVisualBuf tdrVisualBuf = new TdrVisualBuf(); TdrError.ErrorType result = this.visualize(ref tdrVisualBuf, indent, separator); buffer = tdrVisualBuf.getVisualBuf(); return(result); }
public static TdrError.ErrorType tdrIP2Str(ref TdrVisualBuf buf, UInt32 ip) { TdrError.ErrorType ret = TdrError.ErrorType.TDR_NO_ERROR; IPAddress address = new IPAddress((Int64)ip); string strip = address.ToString(); ret = buf.sprintf("{0}", strip); return(ret); }
public TdrError.ErrorType visualize(ref TdrVisualBuf destBuf, int indent, char separator) { TdrError.ErrorType type = TdrError.ErrorType.TDR_NO_ERROR; type = TdrBufUtil.printVariable(ref destBuf, indent, separator, "[stRequestLine]", true); if (type == TdrError.ErrorType.TDR_NO_ERROR) { if (0 > indent) { type = this.stRequestLine.visualize(ref destBuf, indent, separator); } else { type = this.stRequestLine.visualize(ref destBuf, indent + 1, separator); } if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } type = TdrBufUtil.printVariable(ref destBuf, indent, separator, "[stHttpHeaders]", true); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } if (0 > indent) { type = this.stHttpHeaders.visualize(ref destBuf, indent, separator); } else { type = this.stHttpHeaders.visualize(ref destBuf, indent + 1, separator); } if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } type = TdrBufUtil.printVariable(ref destBuf, indent, separator, "[stRequestContent]", true); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } if (0 > indent) { type = this.stRequestContent.visualize(ref destBuf, indent, separator); } else { type = this.stRequestContent.visualize(ref destBuf, indent + 1, separator); } if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } } return(type); }
public TdrError.ErrorType visualize(ref TdrVisualBuf destBuf, int indent, char separator) { TdrError.ErrorType errorType = TdrBufUtil.printVariable(ref destBuf, indent, separator, "[stResponseStatus]", true); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } if (0 > indent) { errorType = this.stResponseStatus.visualize(ref destBuf, indent, separator); } else { errorType = this.stResponseStatus.visualize(ref destBuf, indent + 1, separator); } if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = TdrBufUtil.printVariable(ref destBuf, indent, separator, "[stHttpHeaders]", true); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } if (0 > indent) { errorType = this.stHttpHeaders.visualize(ref destBuf, indent, separator); } else { errorType = this.stHttpHeaders.visualize(ref destBuf, indent + 1, separator); } if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = TdrBufUtil.printVariable(ref destBuf, indent, separator, "[stResponseContent]", true); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } if (0 > indent) { errorType = this.stResponseContent.visualize(ref destBuf, indent, separator); } else { errorType = this.stResponseContent.visualize(ref destBuf, indent + 1, separator); } if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } return(errorType); }
public static TdrError.ErrorType printArray(ref TdrVisualBuf buf, int indent, char sep, string variable, Int64 count) { TdrError.ErrorType ret = TdrError.ErrorType.TDR_NO_ERROR; ret = printMultiStr(ref buf, " ", indent); if (TdrError.ErrorType.TDR_NO_ERROR == ret) { ret = buf.sprintf("{0}[0:{1:d}]: ", variable, count); } return(ret); }
public static TdrError.ErrorType printMultiStr(ref TdrVisualBuf buf, string str, int times) { TdrError.ErrorType ret = TdrError.ErrorType.TDR_NO_ERROR; for (int i = 0; i < times; i++) { ret = buf.sprintf("{0}", str); if (ret != TdrError.ErrorType.TDR_NO_ERROR) { break; } } return(ret); }
public TdrError.ErrorType visualize(ref TdrVisualBuf destBuf, int indent, char separator) { TdrError.ErrorType errorType = TdrBufUtil.printString(ref destBuf, indent, separator, "[szHeaderName]", this.szHeaderName); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = TdrBufUtil.printString(ref destBuf, indent, separator, "[szHeaderContent]", this.szHeaderContent); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } return(errorType); }
public TdrError.ErrorType visualize(ref TdrVisualBuf destBuf, int indent, char separator) { TdrError.ErrorType errorType = TdrBufUtil.printString(ref destBuf, indent, separator, "[szHttpVersion]", this.szHttpVersion); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = TdrBufUtil.printString(ref destBuf, indent, separator, "[szStatusCode]", this.szStatusCode); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = TdrBufUtil.printString(ref destBuf, indent, separator, "[szReasonPhrase]", this.szReasonPhrase); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } return(errorType); }
public TdrError.ErrorType visualize(ref TdrVisualBuf destBuf, int indent, char separator) { TdrError.ErrorType errorType = TdrBufUtil.printVariable(ref destBuf, indent, separator, "[dwDataLen]", "{0:d}", new object[] { this.dwDataLen }); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } if (1048576u < this.dwDataLen) { return(TdrError.ErrorType.TDR_ERR_REFER_SURPASS_COUNT); } errorType = TdrBufUtil.printArray(ref destBuf, indent, separator, "[szData]", (long)((ulong)this.dwDataLen)); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } int num = 0; while ((long)num < (long)((ulong)this.dwDataLen)) { errorType = destBuf.sprintf("0x{0:x2}", new object[] { this.szData[num] }); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } num++; } errorType = destBuf.sprintf("{0}", new object[] { separator }); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } return(errorType); }
public TdrError.ErrorType visualize(ref TdrVisualBuf destBuf, int indent, char separator) { TdrError.ErrorType errorType = TdrBufUtil.printString(ref destBuf, indent, separator, "[szRequestMethod]", this.szRequestMethod); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = TdrBufUtil.printString(ref destBuf, indent, separator, "[szRequestUri]", this.szRequestUri); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } errorType = TdrBufUtil.printString(ref destBuf, indent, separator, "[szHttpVersion]", this.szHttpVersion); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } return(errorType); }
public static TdrError.ErrorType printVariable(ref TdrVisualBuf buf, int indent, char sep, string variable, int arrIdx, bool withSep) { TdrError.ErrorType ret = TdrError.ErrorType.TDR_NO_ERROR; ret = printMultiStr(ref buf, " ", indent); if (TdrError.ErrorType.TDR_NO_ERROR == ret) { if (withSep) { ret = buf.sprintf("{0}[{1:d}]{2}", variable, arrIdx, sep); } else { ret = buf.sprintf("{0}[{1:d}]: ", variable, arrIdx); } } return(ret); }
public TdrError.ErrorType visualize(ref TdrVisualBuf destBuf, int indent, char separator) { TdrError.ErrorType errorType = TdrBufUtil.printVariable(ref destBuf, indent, separator, "[dwHeaderCount]", "{0:d}", new object[] { this.dwHeaderCount }); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } if (32u < this.dwHeaderCount) { return(TdrError.ErrorType.TDR_ERR_REFER_SURPASS_COUNT); } int num = 0; while ((long)num < (long)((ulong)this.dwHeaderCount)) { if (this.astHeaderUnit[num] != null) { errorType = TdrBufUtil.printVariable(ref destBuf, indent, separator, "[astHeaderUnit]", num, true); if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } if (0 > indent) { errorType = this.astHeaderUnit[num].visualize(ref destBuf, indent, separator); } else { errorType = this.astHeaderUnit[num].visualize(ref destBuf, indent + 1, separator); } if (errorType != TdrError.ErrorType.TDR_NO_ERROR) { return(errorType); } } num++; } return(errorType); }
public static TdrError.ErrorType printTdrTime(ref TdrVisualBuf buf, int indent, char sep, string variable, UInt32 time) { TdrError.ErrorType ret = TdrError.ErrorType.TDR_NO_ERROR; ret = printMultiStr(ref buf, " ", indent); if (TdrError.ErrorType.TDR_NO_ERROR == ret) { ret = buf.sprintf("{0}: ", variable); } if (TdrError.ErrorType.TDR_NO_ERROR == ret) { ret = TdrTypeUtil.tdrTime2Str(ref buf, time); } if (TdrError.ErrorType.TDR_NO_ERROR == ret) { ret = buf.sprintf("{0}", sep); } return(ret); }
public static TdrError.ErrorType printVariable(ref TdrVisualBuf buf, int indent, char sep, string variable, int arrIdx, string format, params object[] args) { TdrError.ErrorType ret = TdrError.ErrorType.TDR_NO_ERROR; ret = printMultiStr(ref buf, " ", indent); if (TdrError.ErrorType.TDR_NO_ERROR == ret) { ret = buf.sprintf("{0}[{1:d}]: ", variable, arrIdx); } if (TdrError.ErrorType.TDR_NO_ERROR == ret) { ret = buf.sprintf(format, args); } if (TdrError.ErrorType.TDR_NO_ERROR == ret) { ret = buf.sprintf("{0}", sep); } return(ret); }
public static TdrError.ErrorType printTdrDateTime(ref TdrVisualBuf buf, int indent, char sep, string variable, int arrIdx, UInt64 datetime) { TdrError.ErrorType ret = TdrError.ErrorType.TDR_NO_ERROR; ret = printMultiStr(ref buf, " ", indent); if (TdrError.ErrorType.TDR_NO_ERROR == ret) { ret = buf.sprintf("{0}[{1:d}]: ", variable, arrIdx); } if (TdrError.ErrorType.TDR_NO_ERROR == ret) { ret = TdrTypeUtil.tdrDateTime2Str(ref buf, datetime); } if (TdrError.ErrorType.TDR_NO_ERROR == ret) { ret = buf.sprintf("{0}", sep); } return(ret); }
public static TdrError.ErrorType printString(ref TdrVisualBuf buf, int indent, char sep, string variable, int arrIdx, byte[] bStr) { TdrError.ErrorType ret = TdrError.ErrorType.TDR_NO_ERROR; string strUni = ""; int count = TdrTypeUtil.cstrlen(bStr); if (ret == TdrError.ErrorType.TDR_NO_ERROR) { ret = printMultiStr(ref buf, " ", indent); } if (ret == TdrError.ErrorType.TDR_NO_ERROR) { strUni = Encoding.ASCII.GetString(bStr, 0, count); } if (ret == TdrError.ErrorType.TDR_NO_ERROR) { ret = buf.sprintf("{0}[{1:d}]: {2}{3}", variable, arrIdx, strUni, sep); } return(ret); }
public TdrError.ErrorType visualize(ref TdrVisualBuf destBuf, int indent, char separator) { TdrError.ErrorType type = TdrError.ErrorType.TDR_NO_ERROR; object[] args = new object[] { this.dwHeaderCount }; type = TdrBufUtil.printVariable(ref destBuf, indent, separator, "[dwHeaderCount]", "{0:d}", args); if (type == TdrError.ErrorType.TDR_NO_ERROR) { if (0x20 < this.dwHeaderCount) { return(TdrError.ErrorType.TDR_ERR_REFER_SURPASS_COUNT); } for (int i = 0; i < this.dwHeaderCount; i++) { if (this.astHeaderUnit[i] != null) { type = TdrBufUtil.printVariable(ref destBuf, indent, separator, "[astHeaderUnit]", i, true); if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } if (0 > indent) { type = this.astHeaderUnit[i].visualize(ref destBuf, indent, separator); } else { type = this.astHeaderUnit[i].visualize(ref destBuf, indent + 1, separator); } if (type != TdrError.ErrorType.TDR_NO_ERROR) { return(type); } } } } return(type); }
/* set indent = -1 to disable indent , default: separator = '\n' */ public TdrError.ErrorType visualize(ref TdrVisualBuf destBuf, int indent, char separator) { TdrError.ErrorType ret = TdrError.ErrorType.TDR_NO_ERROR; /* visualize member: this.iMaxOnline */ ret = TdrBufUtil.printVariable(ref destBuf, indent, separator, "[iMaxOnline]", "{0:d}", this.iMaxOnline); if (TdrError.ErrorType.TDR_NO_ERROR != ret) { #if (DEBUG) StackTrace st = new StackTrace(true); for (int i = 0; i < st.FrameCount; i++) { if (null != st.GetFrame(i).GetFileName()) { Console.WriteLine("TSF4G_TRACE: " + st.GetFrame(i).ToString()); } } #endif return(ret); } /* visualize member: this.iCurrentOnline */ ret = TdrBufUtil.printVariable(ref destBuf, indent, separator, "[iCurrentOnline]", "{0:d}", this.iCurrentOnline); if (TdrError.ErrorType.TDR_NO_ERROR != ret) { #if (DEBUG) StackTrace st = new StackTrace(true); for (int i = 0; i < st.FrameCount; i++) { if (null != st.GetFrame(i).GetFileName()) { Console.WriteLine("TSF4G_TRACE: " + st.GetFrame(i).ToString()); } } #endif return(ret); } /* visualize member: this.szConnectUrl */ ret = TdrBufUtil.printString(ref destBuf, indent, separator, "[szConnectUrl]", this.szConnectUrl); if (TdrError.ErrorType.TDR_NO_ERROR != ret) { #if (DEBUG) StackTrace st = new StackTrace(true); for (int i = 0; i < st.FrameCount; i++) { if (null != st.GetFrame(i).GetFileName()) { Console.WriteLine("TSF4G_TRACE: " + st.GetFrame(i).ToString()); } } #endif return(ret); } /* visualize member: this.szPingUrl */ ret = TdrBufUtil.printString(ref destBuf, indent, separator, "[szPingUrl]", this.szPingUrl); if (TdrError.ErrorType.TDR_NO_ERROR != ret) { #if (DEBUG) StackTrace st = new StackTrace(true); for (int i = 0; i < st.FrameCount; i++) { if (null != st.GetFrame(i).GetFileName()) { Console.WriteLine("TSF4G_TRACE: " + st.GetFrame(i).ToString()); } } #endif return(ret); } return(ret); }