campo-sirio/ba/ba8201.h
guy baf2659f8f Patch level : 2.1 nopatch
Files correlati     : ba8.exe
Ricompilazione Demo : [ ]
Commento            :


Risolti conflitti vari e spostate funzioni in cpp piu' consoni


git-svn-id: svn://10.65.10.50/trunk@11862 c028cbd2-c16b-5b4b-a496-9718f37d4682
2004-03-15 15:41:18 +00:00

77 lines
1.6 KiB
C++
Executable File

#ifndef __SQLITE_H
#define __SQLITE_H
#ifndef __SHEET_H
#include <sheet.h>
#endif
///////////////////////////////////////////////////////////
// TSQL_query
///////////////////////////////////////////////////////////
struct TSQL_column_info : public TObject
{
TString _name;
int _width;
bool _numeric;
};
class TSQL_query : public TObject
{
TString _sql;
TRecnotype _firstrow, _pagesize, _items;
TArray _column;
TArray _page;
protected:
void reset();
bool save_as_html(const TFilename& path);
bool save_as_silk(const TFilename& path);
bool save_as_text(const TFilename& path);
bool save_as_campo(const TFilename& path);
public:
void set(const char* sql);
virtual int on_get_items(int argc, char** values, char** columns);
TRecnotype items() const;
const TString_array* row(TRecnotype n);
unsigned int columns() const;
const TSQL_column_info& column_info(unsigned int c) const;
const TToken_string& sheet_head() const; // Used by TQuery_sheet
TSQL_query(const char* sql);
virtual ~TSQL_query() { }
};
///////////////////////////////////////////////////////////
// TQuery_sheet
///////////////////////////////////////////////////////////
class TQuery_sheet : public TSheet
{
TSQL_query& _query;
protected:
virtual void get_row(long r, TToken_string& row);
virtual long get_items() const;
public:
TQuery_sheet(TSQL_query& sql);
};
///////////////////////////////////////////////////////////
// Utility
///////////////////////////////////////////////////////////
void get_sql_directory(TFilename& path);
bool select_sql_file(TFilename& path, const char* ext);
#endif