SecureDelete.PatternWipeStep.ToNative C# (CSharp) Method

ToNative() public method

Get the native form of the step
public ToNative ( ) : string
return string
        public override string ToNative()
        {
            StringBuilder builder = new StringBuilder();
            builder.Append(_number);
            builder.Append(' ');
            builder.Append(MapTypeToNativeType());

            if(_pattern != null) {
                builder.Append(' ');
                builder.Append(_pattern.Length);

                if(_pattern.Length > 0) {
                    builder.Append(" \"");

                    for(int i = 0; i < _pattern.Length; i++) {
                        builder.Append(_pattern[i]);

                        // append a space if not on the last position
                        if(i != _pattern.Length - 1) {
                            builder.Append(' ');
                        }
                    }

                    builder.Append('"');
                }
            }

            return builder.ToString();
        }