Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
IncludeHandler.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using System.IO;
4 
5 namespace SiliconStudio.Shaders.Parser
6 {
7  /// <summary>
8  /// Callback interface to handle included file requested by the <see cref="PreProcessor"/>.
9  /// </summary>
10  public interface IncludeHandler
11  {
12  /// <summary>
13  /// A user-implemented method for opening and reading the contents of a shader #include file.
14  /// </summary>
15  /// <param name="type">A <see cref="IncludeType"/>-typed value that indicates the location of the #include file.</param>
16  /// <param name="fileName">Name of the #include file.</param>
17  /// <param name="parentStream">Pointer to the container that includes the #include file.</param>
18  /// <returns>Stream that is associated with fileName to be read. This reference remains valid until <see cref="IncludeHandler.Close"/> is called.</returns>
19  Stream Open(IncludeType type, string fileName, Stream parentStream);
20 
21  /// <summary>
22  /// A user-implemented method for closing a shader #include file.
23  /// </summary>
24  /// <remarks>
25  /// If <see cref="IncludeHandler.Open"/> was successful, Close is guaranteed to be called before the API using the <see cref="IncludeHandler"/> interface returns.
26  /// </remarks>
27  /// <param name="stream">This is a reference that was returned by the corresponding <see cref="IncludeHandler.Open"/> call.</param>
28  void Close(Stream stream);
29  }
30 }
IncludeType
Type of include file.
Definition: IncludeType.cs:8
Callback interface to handle included file requested by the PreProcessor.