/*
      _______                          .__ .__   .__   .__                 
      \      \    ____   __ __ _______ |__||  |  |  |  |__|  ____    ____  
      /   |   \ _/ __ \ |  |  \\_  __ \|  ||  |  |  |  |  | /  _ \  /    \ 
     /    |    \\  ___/ |  |  / |  | \/|  ||  |__|  |__|  |(  <_> )|   |  \
     \____|__  / \___  >|____/  |__|   |__||____/|____/|__| \____/ |___|  /
    =========\/======\/=================================================\/==
  v0.01 04/JUL/2007 © Copyright 2007-2007 Scott D. Yelich SOME RIGHTS RESERVED
 .,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.-*~'`^`'~*-,._.,-*~'`^`'~*-,. 


  LICENSE:  Creative Commons Attribution 3.0 License.
  SEE:      http://creativecommons.org/licenses/by/3.0/


  Sun Jul 29 21:33:38 EDT 2007, v0.02 sdy

  This is a *very* simple program written to do a web page
  hit counter using sqlite3.

*/

#ifndef XQL3_H
#define XQL3_H

//  C++

#include <string>
#include <vector>

//  SQLITE3

#include <sqlite3.h>

//  

class Xql3
{

  public:

   Xql3();
  ~Xql3();

  int exec(std::string const &);
  int open(std::string const &);
  int close();

  std::vector<std::string> & headers();
  std::vector<std::string> & data();


  private:

  sqlite3 *_db;         //  sqlite3 database

  int _cols;            //  columns in response data
  int _rows;            //  rows in response data
  const char *_dbname;  //  database name
  char **_result;       //  result array
  char *_errm;          //  error message
  int _hsz;             //  header size

  std::vector<std::string> _headers;  //  used to hold reponse headers.
  std::vector<std::string> _data;     //  used to hold response data

};

#endif
