using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace MoonSharp.Interpreter.Loaders
{
///
/// Class dictating how requests to read scripts from files are handled.
///
/// It's recommended that no class implement IScriptLoader directly, and rather extend ScriptLoaderBase.
///
public interface IScriptLoader
{
///
/// Opens a file for reading the script code.
/// It can return either a string, a byte[] or a Stream.
/// If a byte[] is returned, the content is assumed to be a serialized (dumped) bytecode. If it's a string, it's
/// assumed to be either a script or the output of a string.dump call. If a Stream, autodetection takes place.
///
/// The file.
/// The global context.
///
/// A string, a byte[] or a Stream.
///
object LoadFile(string file, Table globalContext);
///
/// Resolves a filename [applying paths, etc.]
///
/// The filename.
/// The global context.
///
[Obsolete("This serves almost no purpose. Kept here just to preserve backward compatibility.")]
string ResolveFileName(string filename, Table globalContext);
///
/// Resolves the name of a module to a filename (which will later be passed to OpenScriptFile)
///
/// The modname.
/// The global context.
///
string ResolveModuleName(string modname, Table globalContext);
}
}