/*
      _______                          .__ .__   .__   .__                 
      \      \    ____   __ __ _______ |__||  |  |  |  |__|  ____    ____  
      /   |   \ _/ __ \ |  |  \\_  __ \|  ||  |  |  |  |  | /  _ \  /    \ 
     /    |    \\  ___/ |  |  / |  | \/|  ||  |__|  |__|  |(  <_> )|   |  \
     \____|__  / \___  >|____/  |__|   |__||____/|____/|__| \____/ |___|  /
    =========\/======\/=================================================\/==
  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/


  Mon Aug 20 23:07:19 EDT 2007, v0.03 sdy
  Thu Aug 23 23:29:36 EDT 2007, v0.04 sdy

  This is Xql3.h, part of Xql.

  See Xql3.cpp for implementation details.

*/

#ifndef XQL3_H
#define XQL3_H

//  C++

#include <string>
#include <vector>

//  SQLITE3

#include <sqlite3.h>

//  PACKAGE

#include "Xql3Exception.h"

//

class Xql3
{

  public:

   Xql3();
   Xql3(std::string const &);
  ~Xql3();

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

  virtual int callback(std::vector<std::string>&, std::vector<std::string>&);

  static int busy(void*, int);

  std::vector<std::string> _headers;
  std::vector<std::string> _data;

  private:

  sqlite3 *_db;
  const char *_db_name;

  sqlite3_stmt * _stmt;

};

#endif
