module charge.sys.file

Source file for Resource and Pool.

Code Map

//! Source file for Resource and Pool.
module charge.sys.file;


//! A single File from the file system or a zip file.
class File : Resource
{
public:
	enum uri;


public:
	size: size_t;
	ptr: immutable(void)*;


public:
	fn data() immutable(void)[] { }


public:
	//! A file that is created from import("filename.txt") import expressions.
	static fn fromImport(filename: string, data: immutable(void)[]) File { }
	//! Same as above, accepts string as that is what ´import("file")´
	//! returns;.
	static fn fromImport(filename: string, data: string) File { }
	static fn load(filename: string) File { }


protected:
	static fn loadFile(filename: string, fp: FILE*, size: size_t) { }
	static fn read(fp: FILE*, ptr: void*, size: size_t) { }
}

//! Dereference and reference helper function.
fn reference(dec: File, inc: File) { }
fn reference(dec: File, inc: File)

Dereference and reference helper function.

Parameters

dec

Object to dereference passed by reference, set to inc.

inc

Object to reference.

class File : Resource

A single File from the file system or a zip file.

Right now very stupid.

fn fromImport(filename: string, data: immutable(void)[]) File

A file that is created from import("filename.txt") import expressions.

fn fromImport(filename: string, data: string) File

Same as above, accepts string as that is what ´import("file")´ returns;.