/*
* TOPPERS/ECNL Prototyping tool
*
* Copyright (C) 2017 Cores Co., Ltd. Japan
*
* 上記著作権者は,以下の(1)~(4)の条件を満たす場合に限り,本ソフトウェ
* ア(本ソフトウェアを改変したものを含む.以下同じ)を使用・複製・改
* 変・再配布(以下,利用と呼ぶ)することを無償で許諾する.
* (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作
* 権表示,この利用条件および下記の無保証規定が,そのままの形でソー
* スコード中に含まれていること.
* (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使
* 用できる形で再配布する場合には,再配布に伴うドキュメント(利用
* 者マニュアルなど)に,上記の著作権表示,この利用条件および下記
* の無保証規定を掲載すること.
* (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使
* 用できない形で再配布する場合には,次のいずれかの条件を満たすこ
* と.
* (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著
* 作権表示,この利用条件および下記の無保証規定を掲載すること.
* (b) 再配布の形態を,別に定める方法によって,TOPPERSプロジェクトに
* 報告すること.
* (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
* 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること.
* また,本ソフトウェアのユーザまたはエンドユーザからのいかなる理
* 由に基づく請求からも,上記著作権者およびTOPPERSプロジェクトを
* 免責すること.
*
* 本ソフトウェアは,無保証で提供されているものである.上記著作権者お
* よびTOPPERSプロジェクトは,本ソフトウェアに関して,特定の使用目的
* に対する適合性も含めて,いかなる保証も行わない.また,本ソフトウェ
* アの利用により直接的または間接的に生じたいかなる損害に関しても,そ
* の責任を負わない.
*
* @(#) $Id$
*/
using System;
using Bridge;
using Bridge.Html5;
[External]
public class FileSystem
{
///
/// Converts a major and minor number into a single unique integer.
/// This is used as an id to represent the device.
///
/// Major number.
/// Minor number.
internal int makedev(int ma, int mi)
{
throw new NotImplementedException();
}
///
/// Registers the specified device driver with a set of callbacks.
///
/// The specific device driver id, created using makedev().
/// The set of callbacks required by the device.
/// For an example, see the NODEFS default callbacks
/// https://github.com/kripken/emscripten/blob/1.29.12/src/library_nodefs.js#L213
internal void registerDevice(int dev, object ops)
{
throw new NotImplementedException();
}
///
/// Sets up standard I/O devices for stdin, stdout, and stderr.
/// The devices are set up using the following (optional) callbacks.
/// If any of the callbacks throw an exception,
/// it will be caught and handled as if the device malfunctioned.
///
/// Input callback. This will be called with
/// no parameters whenever the program attempts to read from stdin.
/// It should return an ASCII character code when data is available,
/// or null when it isn’t.
/// Output callback. This will be called with
/// an ASCII character code whenever the program writes to stdout.
/// It may also be called with null to flush the output.
/// Error callback. This is similar to output,
/// except it is called when data is written to stderr.
///
internal object init(Delegate input, Delegate output, Delegate error)
{
throw new NotImplementedException();
}
///
/// Mounts the FS object specified by type to the directory
/// specified by mountpoint. The opts object is specific
/// to each file system type.
///
/// The file system type: MEMFS, NODEFS, IDBFS or WORKERFS.
/// A generic settings object used by the underlying file system.
/// A path to an existing local Emscripten directory
/// where the file system is to be mounted. It can be either an absolute path,
/// or something relative to the current directory.
internal void mount(object type, object opts, string mountpoint)
{
throw new NotImplementedException();
}
///
/// Unmounts the specified mountpoint.
///
/// The directory to unmount.
internal void unmount(string mountpoint)
{
throw new NotImplementedException();
}
///
/// Responsible for iterating and synchronizing all mounted file systems
/// in an asynchronous fashion.
///
/// true to initialize Emscripten’s file system data
/// with the data from the file system’s persistent source,
/// and false to save Emscripten`s file system data
/// to the file system’s persistent source.
/// A notification callback function
/// that is invoked on completion of the synchronization.
/// If an error occurred, it will be provided as a parameter to this function.
internal void syncfs(bool populate, Delegate callback)
{
}
///
/// Creates a new directory node in the file system.
///
/// The path name for the new directory node.
/// File permissions for the new node.
/// The default setting (in octal numeric notation) is 0777.
internal void mkdir(string path, int mode)
{
throw new NotImplementedException();
}
///
/// Creates a new device node in the file system referencing
/// the registered device driver (FS.registerDevice()) for dev.
///
/// The path name for the new device node.
/// File permissions for the new node.
/// The default setting (in octal numeric notation) is 0777.
/// The registered device driver.
internal void mkdev(string path, int mode, int dev)
{
throw new NotImplementedException();
}
///
/// Creates a symlink node at newpath linking to oldpath.
///
/// The path name of the file to link to.
/// The path to the new symlink node, that points to oldpath.
internal void symlink(string oldpath, string newpath)
{
throw new NotImplementedException();
}
internal Stat stat(string path)
{
return new Stat();
}
internal File open(string path, string flag)
{
return new File();
}
internal void close(File stream)
{
}
internal void read(File stream, Uint8Array buffer, int offset, int length, int position)
{
}
///
/// Writes the entire contents of data to the file at path.
/// The value of opts determines whether data is treated
/// either as a string (encoding = utf8), or as an ArrayBufferView(encoding = binary).
///
/// The file to which to write data.
/// The data to write.
///
/// encoding(string)
/// binary | utf8.The default is utf8
/// flags(string)
/// Write flags, as defined in FS.open(). The default is ‘w’.
///
internal void writeFile(string path, object data, object opts = null)
{
throw new NotImplementedException();
}
///
/// Preloads a file asynchronously, and uses preload plugins to prepare its content.
/// You should call this in preRun, run() will be delayed until all preloaded files are ready.
/// This is how the preload-file option works in emcc
/// when --use-preload-plugins has been specified (if you use this method by itself,
/// you will need to build the program with that option).
///
/// The parent folder, either as a path (e.g. ‘/usr/lib’) or
/// an object previously returned from a FS.createFolder() or FS.createPath() call.
/// The name of the new file.
/// In the browser, this is the URL whose contents will be returned
/// when the file is accessed. In a command line engine,
/// this will be the local (real) file system path the contents
/// will be loaded from. Note that writes to this file are virtual.
/// Whether the file should have read permissions set
/// from the program’s point of view.
/// Whether the file should have write permissions set
/// from the program’s point of view.
internal void createPreloadedFile(string parent, string name, string url, bool canRead, bool canWrite)
{
throw new NotImplementedException();
}
internal void createFolder(string parent, string name, bool canRead, bool canWrite)
{
throw new NotImplementedException();
}
}
[External]
class Stat
{
internal int size = 0;
}
[External]
class File
{
}