Beispiel #1
0
        public static void Write(NullTerminatedString *value)
        {
            var sb = new StringBuffer();

            sb.Append(value);
            sb.WriteTo(Dev);
        }
Beispiel #2
0
        public bool Equals(NullTerminatedString *value)
        {
            var len1 = GetLength();
            var len2 = value->GetLength();

            if (len1 != len2)
            {
                return(false);
            }
            if (len1 == 0)
            {
                return(true);
            }
            var bytes1 = this.Bytes;
            var bytes2 = value->Bytes;

            for (var i = 0; i < len1; i++)
            {
                if (bytes1[i] != bytes2[i])
                {
                    return(false);
                }
            }

            return(true);
        }
Beispiel #3
0
        /// <summary>
        /// Appends a string
        /// </summary>
        public unsafe void Append(NullTerminatedString *value)
        {
            var len = value->GetLength();

            for (var i = 0; i < len; i++)
            {
                Append((char)value->Bytes[i]);
            }
        }
Beispiel #4
0
        public static void WriteLine(NullTerminatedString *value)
        {
            WriteTimeStamp();
            var sb = new StringBuffer();

            sb.Append(value);
            sb.Append('\n');
            sb.WriteTo(Dev);
        }
Beispiel #5
0
        public unsafe void Write(NullTerminatedString *str)
        {
            var len  = str->GetLength();
            var data = str->Bytes;

            for (var i = 0; i < len; i++)
            {
                SendByte((char)data[i]);
            }
        }
Beispiel #6
0
 public static unsafe Process GetProcessByName(NullTerminatedString *name)
 {
     for (var i = 0; i < ProcessList.Count; i++)
     {
         var proc = ProcessList[i];
         if (name->Equals(proc.Path))
         {
             if (proc.RunState == ProcessRunState.Running)
             {
                 return(proc);
             }
         }
     }
     return(null);
 }
Beispiel #7
0
 public static string ToString(NullTerminatedString *str)
 {
     return(new string((sbyte *)str->Bytes));
 }
Beispiel #8
0
 public unsafe StringBuffer(NullTerminatedString *value)
     : this()
 {
     Append(value);
 }
Beispiel #9
0
 public unsafe void WriteLine(NullTerminatedString *str)
 {
     Write(str);
     Write('\n');
 }