Pchp.Library.Streams.PhpStream.PhpStream C# (CSharp) Method

PhpStream() public method

PhpStream is created by a StreamWrapper together with the encapsulated RawStream (the actual file opening is handled by the wrapper).
This class newly implements the auto-remove behavior too (see StreamAccessOptions.Temporary).
public PhpStream ( Context ctx, StreamWrapper openingWrapper, StreamAccessOptions accessOptions, string openedPath, StreamContext context ) : Pchp.Core
ctx Pchp.Core.Context Runtime context.
openingWrapper StreamWrapper The parent instance.
accessOptions StreamAccessOptions The additional options parsed from the fopen() mode.
openedPath string The absolute path to the opened resource.
context StreamContext The stream context passed to fopen().
return Pchp.Core
        public PhpStream(Context ctx, StreamWrapper openingWrapper, StreamAccessOptions accessOptions, string openedPath, StreamContext context)
            : base(PhpStreamTypeName)
        {
            Debug.Assert(ctx != null);
            Debug.Assert(context != null);

            _ctx = ctx;
            _context = context;

            this.Wrapper = openingWrapper;
            this.OpenedPath = openedPath;

            // Stream modifiers (defined in open-time).
            this.Options = accessOptions;

            // Allocate the text conversion filters for this stream.
            if ((accessOptions & StreamAccessOptions.UseText) > 0)
            {
                if ((accessOptions & StreamAccessOptions.Read) > 0)
                {
                    textReadFilter = new TextReadFilter();
                }
                if ((accessOptions & StreamAccessOptions.Write) > 0)
                {
                    textWriteFilter = new TextWriteFilter();
                }
            }

            // this.readTimeout = ScriptContext.CurrentContext.Config.FileSystem.DefaultSocketTimeout;
        }