Made GSM library consistent with Firelance.
This commit is contained in:
@@ -0,0 +1,34 @@
|
||||
using Microsoft.Data.Sqlite;
|
||||
using System;
|
||||
using System.IO;
|
||||
using FireLance.Interfaces;
|
||||
using GSMParser.Inferfaces;
|
||||
|
||||
namespace Gsm
|
||||
{
|
||||
public class GsmMgr : IFlcBaseDBConnection, IGsmSqliteDBConnection
|
||||
{
|
||||
public SqliteConnection Database { get; private set; }
|
||||
|
||||
public void OpenConnection(string dbLocation, int port)
|
||||
{
|
||||
if (File.Exists(dbLocation) == false)
|
||||
{
|
||||
throw new FileNotFoundException(dbLocation);
|
||||
}
|
||||
|
||||
Database = new SqliteConnection($"Data Source={dbLocation};Mode=ReadOnly");
|
||||
Database.Open();
|
||||
}
|
||||
|
||||
public void CloseCurrentConnection()
|
||||
{
|
||||
Database.Close();
|
||||
}
|
||||
|
||||
public bool IsConnectionOpen()
|
||||
{
|
||||
return Convert.ToBoolean(Database.State);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user