import "io_base.jncx"
import "io_File.jnc"
import "std_Buffer.jnc"

//..............................................................................

size_t errorcode loadFile(
	std.Buffer* buffer,
	string_t fileName
) {
	io.File file;
	file.open(fileName, io.FileOpenFlags.ReadOnly);
	buffer.setSize(file.m_size);
	size_t result = file.read(buffer.m_p, buffer.m_size);
	buffer.setSize(result); // update
	return result;
}

//..............................................................................

