Пример #1
0
        /// <summary>
        /// Formats PipData to a command line using the given a <see cref="PipFragmentRenderer"/>.
        /// </summary>
        public string ToString(PipFragmentRenderer renderer)
        {
            Contract.Requires(renderer != null);

            using (PooledObjectWrapper <StringBuilder> wrapper = Pools.GetStringBuilder())
            {
                StringBuilder builder = wrapper.Instance;
                AppendPipData(builder, this, renderer);
                return(builder.ToString());
            }
        }
Пример #2
0
        /// <summary>
        /// Gets the length of the pip data formatted to a command line assuming the given maximum path length.
        /// </summary>
        public int GetMaxPossibleLength(StringTable stringTable)
        {
            Contract.Requires(stringTable != null);

            var renderer       = new PipFragmentRenderer(MaxPathExpander, stringTable, MaxMonikerRenderer);
            int computedLength = GetMaxLength(this, renderer);

#if DEBUG
            // Expensive check on in DEBUG builds: costs 6% percent of entire runtime
            string actualValue = ToString(MaxPathExpander, stringTable, MaxMonikerRenderer);
            Contract.Assert(computedLength == actualValue.Length);
#endif

            return(computedLength);
        }
Пример #3
0
 /// <summary>
 /// Formats PipData to a command line using the given a <see cref="PipFragmentRenderer"/>.
 /// </summary>
 public string ToString(PipFragmentRenderer renderer) => ToString(renderer, useIpcEscaping: false);