|
.NET Framework | |||||||||
| PREV TYPE NEXT TYPE | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONST | PROP | METHOD | OP | EVENT | DETAIL: FIELD | CONST | PROP | METHOD | OP | EVENT | |||||||||
Database. A little wrapper around the in-use database system. Should really be more extendable to support ADO.NET, pluggable DBMSes etc, but this works Right Now.
| Field Summary | |
|---|---|
| System.Data.OleDb.OleDbDataAdapter | adapter |
| System.Data.OleDb.OleDbConnection | connection |
| string | connectUrl |
| Constructor Summary | |
|---|---|
|
Database() Initializes a new instance of the Database class. |
|
| Property Summary | |
|---|---|
| bool | IsOpen |
| Method Summary | |
|---|---|
| bool |
Add(Naanou.ResourceExchange.Entry entry) Adds a new entry. Silently drops metadata entries that are empty |
| void |
Clear() Nuke database contents |
| void |
Close() Close database |
| string | Escape(string str) |
| string |
GetAmount(double amount) Gets a formatted scaled string using the default formatter |
| string |
GetAmount(double amount, string format) Gets a formatted scaled string |
| double |
GetAmount(double amount, string unit) Gets an scaled amount number |
| Naanou.ResourceExchange.Entry |
GetEntry(string path) Gets an entry from its filename |
| Naanou.ResourceExchange.Entry |
GetEntry(Naanou.Common.Hash hash) Gets an entry from a hash |
| Naanou.ResourceExchange.Entry | GetEntryFromQuery(string query) |
| Naanou.ResourceExchange.Entry |
GetEntryFromSerial(string serial) Looks up an entry based on its content hash |
| string |
GetRate(double amount) Gets a formatted scaled rate using default formatter |
| string |
GetRate(double amount, string format) Gets a formatted scaled rate |
| double |
GetRate(double amount, string unit) Gets a scaled rate |
| void | ManipulateEntries(Naanou.ResourceExchange.Database.EntryOp op) |
| void |
Open() Open database |
| void |
Remove(string hashSerial) Remove resource (and any metadata it has) from database |
| System.Data.DataSet | SelectQuery(string qry) |
| int | UpdateQuery(string qry) |
| Methods inherited from class System.Object |
|---|
| Equals, Finalize, GetHashCode, GetType, MemberwiseClone, ToString |
| Field Detail |
|---|
private System.Data.OleDb.OleDbDataAdapter adapter
private System.Data.OleDb.OleDbConnection connection
private string connectUrl
| Constructor Detail |
|---|
private Database()
Initializes a new instance of the Database class.
| Property Detail |
|---|
private bool IsOpen
| Method Detail |
|---|
public bool Add(Naanou.ResourceExchange.Entry entry)
Adds a new entry. Silently drops metadata entries that are empty
Parameters:
entry - public void Clear()
Nuke database contents
internal void Close()
Close database
private string Escape(string str)
public string GetAmount(double amount)
Gets a formatted scaled string using the default formatter
Parameters:
amount - Amount (bytes)public string GetAmount(double amount,
string format)
Gets a formatted scaled string
Parameters:
amount - Amount (bytes)format - Format string to usepublic double GetAmount(double amount,
string unit)
Gets an scaled amount number
Parameters:
amount - Amount (bytes)unit - Unit for new amountpublic Naanou.ResourceExchange.Entry GetEntry(string path)
Gets an entry from its filename
Parameters:
path - public Naanou.ResourceExchange.Entry GetEntry(Naanou.Common.Hash hash)
Gets an entry from a hash
Parameters:
hash - private Naanou.ResourceExchange.Entry GetEntryFromQuery(string query)
public Naanou.ResourceExchange.Entry GetEntryFromSerial(string serial)
Looks up an entry based on its content hash
Parameters:
serial - public string GetRate(double amount)
Gets a formatted scaled rate using default formatter
Parameters:
amount - Amount (bytes/sec)public string GetRate(double amount,
string format)
Gets a formatted scaled rate
Parameters:
amount - Amount (bytes/sec)format - Format string to usepublic double GetRate(double amount,
string unit)
Gets a scaled rate
Parameters:
amount - Amount (bytes/s)unit - Unitinternal void ManipulateEntries(Naanou.ResourceExchange.Database.EntryOp op)
private void Open()
Open database
public void Remove(string hashSerial)
Remove resource (and any metadata it has) from database
Parameters:
hashSerial - private System.Data.DataSet SelectQuery(string qry)
private int UpdateQuery(string qry)
|
.NET Framework | |||||||||
| PREV TYPE NEXT TYPE | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONST | PROP | METHOD | OP | EVENT | DETAIL: FIELD | CONST | PROP | METHOD | OP | EVENT | |||||||||