Exemple #1
0
        /// <summary>
        /// Appends a substring of the specified string pointer to the <see cref="StringBuilder"/>.
        /// </summary>
        /// <param name="sb">The <see cref="StringBuilder"/> to which to append the value.</param>
        /// <param name="ptr">A pointer to the unmanaged string that contains the substring to append.</param>
        /// <param name="offset">The offset into the string at which the substring begins.</param>
        /// <param name="length">The length of the substring.</param>
        public static void AppendStringPtr(this StringBuilder sb, StringPtr16 ptr, Int32 offset, Int32 length)
        {
            Contract.Require(sb, nameof(sb));

            if (ptr == StringPtr16.Zero)
            {
                return;
            }

            for (int i = offset; i < offset + length; i++)
            {
                sb.Append(ptr[i]);
            }
        }
Exemple #2
0
 /// <summary>
 /// Appends the specified string pointer to the <see cref="StringBuilder"/>.
 /// </summary>
 /// <param name="sb">The <see cref="StringBuilder"/> to which to append the value.</param>
 /// <param name="ptr">A pointer to the unmanaged string to append.</param>
 public static void AppendStringPtr(this StringBuilder sb, StringPtr16 ptr)
 {
     AppendStringPtr(sb, ptr, 0, ptr.Length);
 }