74 lines
1.5 KiB
C++
74 lines
1.5 KiB
C++
#pragma once
|
|
#ifndef GdataTable_h
|
|
#define GdataTable_h
|
|
//tabla de datos generica
|
|
//tabla con nombre de columnas
|
|
#include "base_head.h"
|
|
#include "garray.h"
|
|
#include "StrArray.h"
|
|
class UTILES_EXPORT GdataTableColum
|
|
{
|
|
public:
|
|
int type;//tipo de dato
|
|
int nb;//numero de bytes de informacion
|
|
int flags;
|
|
};
|
|
|
|
class UTILES_EXPORT GdataTable
|
|
{
|
|
Cgarray<void*>buf; //array de Garray de datos
|
|
Cgarray<GdataTableColum>colm; //datos de columnas
|
|
StrArray colmName; //nombre de columnas
|
|
|
|
public:
|
|
enum TypedataTable
|
|
{
|
|
Tndef=0,
|
|
Tbool,
|
|
Tint,
|
|
Tdouble,
|
|
Tint64,
|
|
Tstring,
|
|
Tbin,
|
|
Tntip
|
|
};
|
|
GdataTable(void);
|
|
~GdataTable(void);
|
|
|
|
//funciones de lectura y set------------
|
|
int getType(int icol);
|
|
int getInd(char* colName);
|
|
int nRow();
|
|
int nColm();
|
|
int getSize(int icol);
|
|
int getSizeASCII(int icol);
|
|
|
|
char* getName(int icol);
|
|
bool rename(int icol, char* nomb);
|
|
int* getI(int row, int colm);
|
|
__int64* getI64(int row, int colm);
|
|
double* getD(int row, int colm);
|
|
char* getS(int row, int colm);
|
|
void* getBin(int row, int colm);
|
|
bool* getBool(int row, int col);
|
|
|
|
void* get(int row, int colm);
|
|
//funciones de modificacion-------------
|
|
|
|
//adicionar-----------------------------
|
|
bool addColm(char* name, int type, int size=0);
|
|
bool addRow(int nrow);
|
|
bool addMemRow(int nrow);
|
|
//borrado-------------------------------
|
|
void delAllRow();//borra todas las filas
|
|
void delAll();//borra todo
|
|
|
|
void removeRow(int i);
|
|
void removeColm(int i);
|
|
|
|
//ajusta memoria
|
|
void clear();
|
|
//funciones auxiliares--------------------
|
|
private:
|
|
};
|
|
#endif |