324 lines
11 KiB
C#
324 lines
11 KiB
C#
/* ----------------------------------------------------------------------------
|
|
* This file was automatically generated by SWIG (http://www.swig.org).
|
|
* Version 2.0.12
|
|
*
|
|
* Do not make changes to this file unless you know what you are doing--modify
|
|
* the SWIG interface file instead.
|
|
* ----------------------------------------------------------------------------- */
|
|
|
|
namespace SLNet {
|
|
|
|
using System;
|
|
using System.Runtime.InteropServices;
|
|
|
|
public class Table : IDisposable {
|
|
private HandleRef swigCPtr;
|
|
protected bool swigCMemOwn;
|
|
|
|
internal Table(IntPtr cPtr, bool cMemoryOwn) {
|
|
swigCMemOwn = cMemoryOwn;
|
|
swigCPtr = new HandleRef(this, cPtr);
|
|
}
|
|
|
|
internal static HandleRef getCPtr(Table obj) {
|
|
return (obj == null) ? new HandleRef(null, IntPtr.Zero) : obj.swigCPtr;
|
|
}
|
|
|
|
~Table() {
|
|
Dispose();
|
|
}
|
|
|
|
public virtual void Dispose() {
|
|
lock(this) {
|
|
if (swigCPtr.Handle != IntPtr.Zero) {
|
|
if (swigCMemOwn) {
|
|
swigCMemOwn = false;
|
|
SLikeNetPINVOKE.delete_Table(swigCPtr);
|
|
}
|
|
swigCPtr = new HandleRef(null, IntPtr.Zero);
|
|
}
|
|
GC.SuppressFinalize(this);
|
|
}
|
|
}
|
|
|
|
|
|
public RakNetPageRow GetListHead() {
|
|
return GetListHeadHelper();
|
|
}
|
|
|
|
public void SortTable(SortQuery [] sortQueries, uint numSortQueries, out Row[] arg2)
|
|
{
|
|
RakNetListSortQuery sortQueriesList =null;
|
|
if (sortQueries!=null)
|
|
{
|
|
sortQueriesList = new RakNetListSortQuery();
|
|
int listLen = sortQueries.Length;
|
|
for (int i = 0; i < listLen; i++)
|
|
{
|
|
sortQueriesList.Insert(sortQueries[i], "", 1);
|
|
}
|
|
}
|
|
|
|
int rowCount= (int)GetRowCount();
|
|
Row[] rowArray= new Row[rowCount];
|
|
RakNetListTableRow passVal = new RakNetListTableRow();
|
|
SortTableHelper(sortQueriesList,numSortQueries,passVal);
|
|
for (int i=0; i<rowCount;i++)
|
|
{
|
|
rowArray[i]=passVal[i];
|
|
}
|
|
arg2=rowArray;
|
|
}
|
|
|
|
public void GetCellValueByIndex(uint rowIndex, uint columnIndex, out byte[] outByteArray, out int outputLength)
|
|
{
|
|
int returnInt=0;
|
|
Row row = GetRowByIndex(rowIndex,ref returnInt);
|
|
int arrayLen=0;
|
|
if (row!=null)
|
|
{
|
|
arrayLen=(int)row.cells[(int)columnIndex].i;
|
|
}
|
|
byte[] inOutByteArray = new byte[arrayLen];
|
|
GetCellValueByIndexHelper(rowIndex,columnIndex,inOutByteArray,out outputLength);
|
|
outByteArray=inOutByteArray;
|
|
}
|
|
|
|
public void GetCellValueByIndex(uint rowIndex, uint columnIndex,out string output)
|
|
{
|
|
int returnInt=0;
|
|
Row row = GetRowByIndex(rowIndex,ref returnInt);
|
|
int arrayLen=0;
|
|
if (row!=null)
|
|
{
|
|
arrayLen=(int)row.cells[(int)columnIndex].i;
|
|
}
|
|
String tmp = new String('c', arrayLen);
|
|
output=GetCellValueByIndexHelper( rowIndex, columnIndex, tmp);
|
|
}
|
|
|
|
public void QueryTable(uint[] columnIndicesSubset, uint numColumnSubset, FilterQuery[] inclusionFilters, uint numInclusionFilters, uint[] rowIds, uint numRowIDs, Table result)
|
|
{
|
|
RakNetListFilterQuery inclusionFiltersList =null;
|
|
if (inclusionFiltersList!=null)
|
|
{
|
|
inclusionFiltersList = new RakNetListFilterQuery();
|
|
int listLen = inclusionFilters.Length;
|
|
for (int i = 0; i < listLen; i++)
|
|
{
|
|
inclusionFiltersList.Insert(inclusionFilters[i], "", 1);
|
|
}
|
|
}
|
|
QueryTableHelper(columnIndicesSubset, numColumnSubset, inclusionFiltersList, numInclusionFilters, rowIds, numRowIDs, result);
|
|
}
|
|
|
|
public uint ColumnIndex(string columnName) {
|
|
return ColumnIndexHelper(columnName);
|
|
}
|
|
|
|
public Table() : this(SLikeNetPINVOKE.new_Table(), true) {
|
|
}
|
|
|
|
public uint AddColumn(string columnName, Table.ColumnType columnType) {
|
|
uint ret = SLikeNetPINVOKE.Table_AddColumn(swigCPtr, columnName, (int)columnType);
|
|
return ret;
|
|
}
|
|
|
|
public void RemoveColumn(uint columnIndex) {
|
|
SLikeNetPINVOKE.Table_RemoveColumn(swigCPtr, columnIndex);
|
|
}
|
|
|
|
public string ColumnName(uint index) {
|
|
string ret = SLikeNetPINVOKE.Table_ColumnName(swigCPtr, index);
|
|
return ret;
|
|
}
|
|
|
|
public Table.ColumnType GetColumnType(uint index) {
|
|
Table.ColumnType ret = (Table.ColumnType)SLikeNetPINVOKE.Table_GetColumnType(swigCPtr, index);
|
|
return ret;
|
|
}
|
|
|
|
public uint GetColumnCount() {
|
|
uint ret = SLikeNetPINVOKE.Table_GetColumnCount(swigCPtr);
|
|
return ret;
|
|
}
|
|
|
|
public uint GetRowCount() {
|
|
uint ret = SLikeNetPINVOKE.Table_GetRowCount(swigCPtr);
|
|
return ret;
|
|
}
|
|
|
|
public Row AddRow(uint rowId) {
|
|
IntPtr cPtr = SLikeNetPINVOKE.Table_AddRow__SWIG_0(swigCPtr, rowId);
|
|
Row ret = (cPtr == IntPtr.Zero) ? null : new Row(cPtr, false);
|
|
return ret;
|
|
}
|
|
|
|
public Row AddRow(uint rowId, RakNetListCell initialCellValues) {
|
|
IntPtr cPtr = SLikeNetPINVOKE.Table_AddRow__SWIG_1(swigCPtr, rowId, RakNetListCell.getCPtr(initialCellValues));
|
|
Row ret = (cPtr == IntPtr.Zero) ? null : new Row(cPtr, false);
|
|
if (SLikeNetPINVOKE.SWIGPendingException.Pending) throw SLikeNetPINVOKE.SWIGPendingException.Retrieve();
|
|
return ret;
|
|
}
|
|
|
|
public Row AddRow(uint rowId, RakNetListCellPointer initialCellValues, bool copyCells) {
|
|
IntPtr cPtr = SLikeNetPINVOKE.Table_AddRow__SWIG_2(swigCPtr, rowId, RakNetListCellPointer.getCPtr(initialCellValues), copyCells);
|
|
Row ret = (cPtr == IntPtr.Zero) ? null : new Row(cPtr, false);
|
|
if (SLikeNetPINVOKE.SWIGPendingException.Pending) throw SLikeNetPINVOKE.SWIGPendingException.Retrieve();
|
|
return ret;
|
|
}
|
|
|
|
public Row AddRow(uint rowId, RakNetListCellPointer initialCellValues) {
|
|
IntPtr cPtr = SLikeNetPINVOKE.Table_AddRow__SWIG_3(swigCPtr, rowId, RakNetListCellPointer.getCPtr(initialCellValues));
|
|
Row ret = (cPtr == IntPtr.Zero) ? null : new Row(cPtr, false);
|
|
if (SLikeNetPINVOKE.SWIGPendingException.Pending) throw SLikeNetPINVOKE.SWIGPendingException.Retrieve();
|
|
return ret;
|
|
}
|
|
|
|
public bool RemoveRow(uint rowId) {
|
|
bool ret = SLikeNetPINVOKE.Table_RemoveRow(swigCPtr, rowId);
|
|
return ret;
|
|
}
|
|
|
|
public void RemoveRows(Table tableContainingRowIDs) {
|
|
SLikeNetPINVOKE.Table_RemoveRows(swigCPtr, Table.getCPtr(tableContainingRowIDs));
|
|
}
|
|
|
|
public bool UpdateCell(uint rowId, uint columnIndex, int value) {
|
|
bool ret = SLikeNetPINVOKE.Table_UpdateCell__SWIG_0(swigCPtr, rowId, columnIndex, value);
|
|
return ret;
|
|
}
|
|
|
|
public bool UpdateCell(uint rowId, uint columnIndex, string str) {
|
|
bool ret = SLikeNetPINVOKE.Table_UpdateCell__SWIG_1(swigCPtr, rowId, columnIndex, str);
|
|
return ret;
|
|
}
|
|
|
|
public bool UpdateCellByIndex(uint rowIndex, uint columnIndex, int value) {
|
|
bool ret = SLikeNetPINVOKE.Table_UpdateCellByIndex__SWIG_0(swigCPtr, rowIndex, columnIndex, value);
|
|
return ret;
|
|
}
|
|
|
|
public bool UpdateCellByIndex(uint rowIndex, uint columnIndex, string str) {
|
|
bool ret = SLikeNetPINVOKE.Table_UpdateCellByIndex__SWIG_1(swigCPtr, rowIndex, columnIndex, str);
|
|
return ret;
|
|
}
|
|
|
|
public void GetCellValueByIndex(uint rowIndex, uint columnIndex, out int output) {
|
|
SLikeNetPINVOKE.Table_GetCellValueByIndex__SWIG_0(swigCPtr, rowIndex, columnIndex, out output);
|
|
}
|
|
|
|
public void GetCellValueByIndex(uint rowIndex, uint columnIndex, string output, uint outputLength) {
|
|
SLikeNetPINVOKE.Table_GetCellValueByIndex__SWIG_1(swigCPtr, rowIndex, columnIndex, output, outputLength);
|
|
}
|
|
|
|
public Row GetRowByID(uint rowId) {
|
|
IntPtr cPtr = SLikeNetPINVOKE.Table_GetRowByID(swigCPtr, rowId);
|
|
Row ret = (cPtr == IntPtr.Zero) ? null : new Row(cPtr, false);
|
|
return ret;
|
|
}
|
|
|
|
public Row GetRowByIndex(uint rowIndex, ref int key) {
|
|
IntPtr cPtr = SLikeNetPINVOKE.Table_GetRowByIndex(swigCPtr, rowIndex, ref key);
|
|
Row ret = (cPtr == IntPtr.Zero) ? null : new Row(cPtr, false);
|
|
return ret;
|
|
}
|
|
|
|
public void Clear() {
|
|
SLikeNetPINVOKE.Table_Clear(swigCPtr);
|
|
}
|
|
|
|
public RakNetListColumnDescriptor GetColumns() {
|
|
RakNetListColumnDescriptor ret = new RakNetListColumnDescriptor(SLikeNetPINVOKE.Table_GetColumns(swigCPtr), false);
|
|
return ret;
|
|
}
|
|
|
|
public RakNetBPlusTreeRow GetRows() {
|
|
RakNetBPlusTreeRow ret = new RakNetBPlusTreeRow(SLikeNetPINVOKE.Table_GetRows(swigCPtr), false);
|
|
return ret;
|
|
}
|
|
|
|
public uint GetAvailableRowId() {
|
|
uint ret = SLikeNetPINVOKE.Table_GetAvailableRowId(swigCPtr);
|
|
return ret;
|
|
}
|
|
|
|
public Table CopyData(Table input) {
|
|
Table ret = new Table(SLikeNetPINVOKE.Table_CopyData(swigCPtr, Table.getCPtr(input)), false);
|
|
if (SLikeNetPINVOKE.SWIGPendingException.Pending) throw SLikeNetPINVOKE.SWIGPendingException.Retrieve();
|
|
return ret;
|
|
}
|
|
|
|
private RakNetPageRow GetListHeadHelper() {
|
|
IntPtr cPtr = SLikeNetPINVOKE.Table_GetListHeadHelper(swigCPtr);
|
|
RakNetPageRow ret = (cPtr == IntPtr.Zero) ? null : new RakNetPageRow(cPtr, false);
|
|
return ret;
|
|
}
|
|
|
|
private void SortTableHelper(RakNetListSortQuery sortQueries, uint numSortQueries, RakNetListTableRow arg2) {
|
|
SLikeNetPINVOKE.Table_SortTableHelper(swigCPtr, RakNetListSortQuery.getCPtr(sortQueries), numSortQueries, RakNetListTableRow.getCPtr(arg2));
|
|
}
|
|
|
|
private void GetCellValueByIndexHelper(uint rowIndex, uint columnIndex, byte[] inOutByteArray, out int outputLength) {
|
|
SLikeNetPINVOKE.Table_GetCellValueByIndexHelper__SWIG_0(swigCPtr, rowIndex, columnIndex, inOutByteArray, out outputLength);
|
|
}
|
|
|
|
private string GetCellValueByIndexHelper(uint rowIndex, uint columnIndex, string output) {
|
|
string ret = SLikeNetPINVOKE.Table_GetCellValueByIndexHelper__SWIG_1(swigCPtr, rowIndex, columnIndex, output);
|
|
return ret;
|
|
}
|
|
|
|
public void PrintColumnHeaders(byte[] inOutByteArray, int byteArrayLength, char columnDelineator) {
|
|
SLikeNetPINVOKE.Table_PrintColumnHeaders(swigCPtr, inOutByteArray, byteArrayLength, columnDelineator);
|
|
}
|
|
|
|
public void PrintRow(byte[] inOutByteArray, int byteArrayLength, char columnDelineator, bool printDelineatorForBinary, Row inputRow) {
|
|
SLikeNetPINVOKE.Table_PrintRow(swigCPtr, inOutByteArray, byteArrayLength, columnDelineator, printDelineatorForBinary, Row.getCPtr(inputRow));
|
|
}
|
|
|
|
private void QueryTableHelper(uint[] columnIndicesSubset, uint numColumnSubset, RakNetListFilterQuery inclusionFilters, uint numInclusionFilters, uint[] rowIds, uint numRowIDs, Table result) {
|
|
SLikeNetPINVOKE.Table_QueryTableHelper(swigCPtr, columnIndicesSubset, numColumnSubset, RakNetListFilterQuery.getCPtr(inclusionFilters), numInclusionFilters, rowIds, numRowIDs, Table.getCPtr(result));
|
|
}
|
|
|
|
public bool UpdateCell(uint rowId, uint columnIndex, int byteLength, byte[] inByteArray) {
|
|
bool ret = SLikeNetPINVOKE.Table_UpdateCell__SWIG_2(swigCPtr, rowId, columnIndex, byteLength, inByteArray);
|
|
return ret;
|
|
}
|
|
|
|
public bool UpdateCellByIndex(uint rowIndex, uint columnIndex, int byteLength, byte[] inByteArray) {
|
|
bool ret = SLikeNetPINVOKE.Table_UpdateCellByIndex__SWIG_2(swigCPtr, rowIndex, columnIndex, byteLength, inByteArray);
|
|
return ret;
|
|
}
|
|
|
|
private uint ColumnIndexHelper(string columnName) {
|
|
uint ret = SLikeNetPINVOKE.Table_ColumnIndexHelper(swigCPtr, columnName);
|
|
return ret;
|
|
}
|
|
|
|
public enum ColumnType {
|
|
NUMERIC,
|
|
STRING,
|
|
BINARY,
|
|
POINTER
|
|
}
|
|
|
|
public enum FilterQueryType {
|
|
QF_EQUAL,
|
|
QF_NOT_EQUAL,
|
|
QF_GREATER_THAN,
|
|
QF_GREATER_THAN_EQ,
|
|
QF_LESS_THAN,
|
|
QF_LESS_THAN_EQ,
|
|
QF_IS_EMPTY,
|
|
QF_NOT_EMPTY
|
|
}
|
|
|
|
public enum SortQueryType {
|
|
QS_INCREASING_ORDER,
|
|
QS_DECREASING_ORDER
|
|
}
|
|
|
|
}
|
|
|
|
}
|