2016-01-27 22:04:37 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.Linq;
|
|
|
|
|
using System.Text;
|
|
|
|
|
using System.Threading.Tasks;
|
|
|
|
|
|
|
|
|
|
namespace Test
|
|
|
|
|
{
|
|
|
|
|
class Program
|
|
|
|
|
{
|
2016-01-28 17:49:32 +00:00
|
|
|
|
static void PrintSupportedArchives()
|
|
|
|
|
{
|
|
|
|
|
Console.Write("Supported archive types: ");
|
|
|
|
|
bool any = false;
|
|
|
|
|
foreach (var archive in PhysFS.PhysFS.SupportedArchiveTypes())
|
|
|
|
|
{
|
|
|
|
|
any = true;
|
|
|
|
|
Console.WriteLine("\n - {0}: {1}", archive.extension, archive.description);
|
|
|
|
|
Console.WriteLine(" Written by {0}", archive.author);
|
|
|
|
|
Console.Write(" {0}", archive.url);
|
|
|
|
|
}
|
|
|
|
|
if (!any)
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine("NONE.");
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
Console.WriteLine();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2016-01-27 22:04:37 +00:00
|
|
|
|
static void Main(string[] args)
|
|
|
|
|
{
|
2016-01-28 17:49:32 +00:00
|
|
|
|
try
|
|
|
|
|
{
|
|
|
|
|
PhysFS.PhysFS.InitializeCallbacks();
|
|
|
|
|
}
|
|
|
|
|
catch (PhysFS.PhysFSLibNotFound)
|
|
|
|
|
{
|
|
|
|
|
Console.ForegroundColor = ConsoleColor.Red;
|
|
|
|
|
Console.Error.WriteLine("ERROR: PhysFS could not be loaded. Are you sure it is installed or a suitable module is in your working directory?");
|
|
|
|
|
return;
|
|
|
|
|
}
|
2016-01-27 22:04:37 +00:00
|
|
|
|
PhysFS.PhysFS.Init("");
|
2016-01-28 17:49:32 +00:00
|
|
|
|
|
|
|
|
|
var version = PhysFS.PhysFS.GetLinkedVersion();
|
|
|
|
|
|
|
|
|
|
Console.WriteLine("SharpPhysFS Test console");
|
|
|
|
|
Console.WriteLine("Loaded PhysFS version: {0}.{1}.{2}", version.major, version.minor, version.patch);
|
|
|
|
|
PrintSupportedArchives();
|
|
|
|
|
|
|
|
|
|
Console.WriteLine("Type 'help' for a list of commands");
|
|
|
|
|
while(true)
|
|
|
|
|
{
|
|
|
|
|
Console.Write("> ");
|
|
|
|
|
var input = Console.ReadLine();
|
|
|
|
|
}
|
|
|
|
|
|
2016-01-27 22:04:37 +00:00
|
|
|
|
PhysFS.PhysFS.Deinit();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|