/*-
* See the file LICENSE for redistribution information.
*
* Copyright (c) 2009 Oracle. All rights reserved.
*
*/
using System;
using System.Collections.Generic;
using System.Text;
using BerkeleyDB.Internal;
namespace BerkeleyDB {
///
/// A class representing the supported Berkeley DB access methods.
///
public class DatabaseType {
///
/// BTree access method
///
public static readonly DatabaseType BTREE
= new DatabaseType(DBTYPE.DB_BTREE);
///
/// Hash access method
///
public static readonly DatabaseType HASH
= new DatabaseType(DBTYPE.DB_HASH);
///
/// Recno access method
///
public static readonly DatabaseType RECNO
= new DatabaseType(DBTYPE.DB_RECNO);
///
/// Queue access method
///
public static readonly DatabaseType QUEUE
= new DatabaseType(DBTYPE.DB_QUEUE);
///
/// Unknown access method
///
public static readonly DatabaseType UNKNOWN
= new DatabaseType(DBTYPE.DB_UNKNOWN);
private BerkeleyDB.Internal.DBTYPE dbtype;
private DatabaseType(BerkeleyDB.Internal.DBTYPE type) {
dbtype = type;
}
internal BerkeleyDB.Internal.DBTYPE getDBTYPE() {
return dbtype;
}
///
/// Convert this instance of DatabaseType to its string representation.
///
/// A string representation of this instance.
public override string ToString() {
switch (dbtype) {
case DBTYPE.DB_BTREE:
return "BTree";
case DBTYPE.DB_HASH:
return "Hash";
case DBTYPE.DB_QUEUE:
return "Queue";
case DBTYPE.DB_RECNO:
return "Recno";
default:
return "Unknown";
}
}
}
}