Exemple #1
0
        public SafePtr ToNullTermPtr()
        {
            var b = new SafePtr();

            int i = 0;

            foreach (var s in this)
            {
                i += (s.Length + 1) * sizeof(char);
            }

            i += sizeof(char);

            b.Length = i;


            int idx = 0;

            foreach (var s in this)
            {
                b.SetString(idx, s);
                idx += (s.Length + 1) * sizeof(char);
            }

            return(b);
        }