mirror of
https://github.com/Ragora/T2-BoL.git
synced 2026-03-09 15:30:27 +00:00
Did stuff.
This commit is contained in:
parent
09f43122e6
commit
8c96cba3e1
132 changed files with 56515 additions and 1448 deletions
|
|
@ -6,13 +6,13 @@
|
|||
function getFileBuffer(%file)
|
||||
{
|
||||
if (!IsFile(%file))
|
||||
return "Not existant.";
|
||||
return -1;
|
||||
|
||||
new FileObject(FileBuffer);
|
||||
FileBuffer.openForRead(%file);
|
||||
|
||||
while (!FileBuffer.isEOF())
|
||||
%buffer = FileBuffer.readLine() @ "\n";
|
||||
%buffer = %buffer @ FileBuffer.readLine() @ "\n";
|
||||
FileBuffer.detach();
|
||||
return %buffer; //Long string. >.>
|
||||
}
|
||||
|
|
@ -20,7 +20,7 @@ function getFileBuffer(%file)
|
|||
function getLine(%file, %line)
|
||||
{
|
||||
if (!IsFile(%file))
|
||||
return "Not existant.";
|
||||
return -1;
|
||||
|
||||
new FileObject(FileLine);
|
||||
FileLine.openForRead(%file);
|
||||
|
|
@ -34,7 +34,7 @@ function getLine(%file, %line)
|
|||
function getLine(%file, %line)
|
||||
{
|
||||
if (!IsFile(%file))
|
||||
return "Not existant.";
|
||||
return -1;
|
||||
|
||||
new FileObject(FileLine);
|
||||
FileLine.openForRead(%file);
|
||||
|
|
@ -45,6 +45,30 @@ function getLine(%file, %line)
|
|||
return %line;
|
||||
}
|
||||
|
||||
// Returns an unsorted list of the contents of %dir (including folders)
|
||||
function getDirectory(%dir)
|
||||
{
|
||||
%array = Array.create();
|
||||
|
||||
%fileCount = 0;
|
||||
for( %file = findFirstFile( %dir @ "*.*" ); %file !$= ""; %file = findNextFile( %dir @ "*.*" ) )
|
||||
{
|
||||
%file = strReplace(%file, %socket.request, "");
|
||||
if (strStr(%file, "/") != -1)
|
||||
{
|
||||
%dir = getSubStr(%file, 0, strStr(%file, "/")) @ "/";
|
||||
if (!%dirAdded[%dir])
|
||||
{
|
||||
%data = %data @ "<a href=\"" @ strReplace(%dir, " ","%20") @ "\">" @ %dir @ "</a><br>\n";
|
||||
%dirAdded[%dir] = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
%data = %data @ "<a href=\"" @ strReplace(%file, " ", "%20") @ "\">" @ %file @ "</a><br>\n";
|
||||
}
|
||||
return %array;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------
|
||||
// Bound Functions
|
||||
// -----------------------------------------------------
|
||||
|
|
@ -54,7 +78,3 @@ function fileObject::Detach(%this) //Detaches fileObject from file & deletes
|
|||
%this.delete();
|
||||
return %this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue