Initial commit.

This commit is contained in:
Robert MacGregor 2012-07-27 17:22:05 -04:00
commit 9a05e8d86c
652 changed files with 154587 additions and 0 deletions

View file

@ -0,0 +1,66 @@
// -----------------------------------------------------
// Basic file functions
// -----------------------------------------------------
function getFileBuffer(%file)
{
if (!IsFile(%file))
return "Not existant.";
new FileObject(FileBuffer);
FileBuffer.openForRead(%file);
while (!FileBuffer.isEOF())
{
%buffer = FileBuffer.readLine() @ "\n";
}
FileBuffer.detach();
return %buffer; //Long string. >.>
}
function getLine(%file, %line)
{
if (!IsFile(%file))
return "Not existant.";
new FileObject(FileLine);
FileLine.openForRead(%file);
for (%i = 0; %i < %line; %i++)
{
%line = FileLine.readLine();
}
FileLine.detach();
return %line;
}
function getLine(%file, %line)
{
if (!IsFile(%file))
return "Not existant.";
new FileObject(FileLine);
FileLine.openForRead(%file);
for (%i = 0; %i < %line; %i++)
{
%line = FileLine.readLine();
}
FileLine.detach();
return %line;
}
// -----------------------------------------------------
// Bound Functions
// -----------------------------------------------------
function fileObject::Detach(%this) //Detaches fileObject from file & deletes
{
%this.close();
%this.delete();
return %this;
}