コード例 #1
0
        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);
        }
コード例 #2
0
ファイル: ResponseContent.cs プロジェクト: isoundy000/wzry-1
 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);
 }
コード例 #3
0
ファイル: GSDef.cs プロジェクト: ghrguse/ss
        /* 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);
        }
コード例 #4
0
        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);
        }
コード例 #5
0
ファイル: GSDef.cs プロジェクト: ghrguse/ss
        public TdrError.ErrorType visualize(ref TdrVisualBuf destBuf, int indent, char separator)
        {
#if (DEBUG)
            TdrDebug.tdrTrace();
#endif
            return(TdrError.ErrorType.TDR_ERR_METHOD_NOT_IMPLEMENTED);
        }
コード例 #6
0
ファイル: HttpReq.cs プロジェクト: isoundy000/wzry-1
        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);
        }
コード例 #7
0
        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);
        }
コード例 #8
0
        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);
        }
コード例 #9
0
ファイル: HttpReq.cs プロジェクト: isoundy000/wzry-1
 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);
 }
コード例 #10
0
 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);
 }
コード例 #11
0
        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);
        }
コード例 #12
0
        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);
        }
コード例 #13
0
 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);
 }
コード例 #14
0
 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);
 }
コード例 #15
0
        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);
        }
コード例 #16
0
 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);
 }
コード例 #17
0
        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);
        }
コード例 #18
0
        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);
        }
コード例 #19
0
        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);
        }
コード例 #20
0
        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);
        }
コード例 #21
0
        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);
        }
コード例 #22
0
        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);
        }
コード例 #23
0
 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);
 }
コード例 #24
0
        /* 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);
        }