Click here to Skip to main content
Click here to Skip to main content
Add your own
alternative version

A C++ Embedded Web Server

, 23 Jun 2014 BSD
Give a C++ application its own web page
webem_demo.zip
code_project
examples
webemCalendar
calendar.dat
sqlite3.dll
webemCalendar.vcproj.CORVIS.james.user
webemHello
webemHello.vcproj.CORVIS.james.user
webemHelloForm
webemHelloForm.vcproj.CORVIS.james.user
webemMT
webemMT.vcproj.CORVIS.james.user
src
sqlite
sqlite3.lib
webem
server
Jamfile
Jamfile.v2
webem_src.zip
manifest
manifest.uuid
webem.fossil
_FOSSIL_
doc
DoxyFile
html
doxygen.png
tab_b.gif
tab_l.gif
tab_r.gif
examples
webemButton
webemCalendar
calendar.dat
sqlite3.dll
sqlite3.lib
WebemHello
webemHelloForm
server
/*
  SQLiteDatabase.h - CSQLiteDatabase interface, a wrapper for the SQLite database
*/
#pragma once

#include "sqlite3.h"

#include <string>
using std::string;
using std::wstring;

#include <vector>
using std::vector;

/// Access to SQLite databases
class CSQLiteDatabase
{
public:

/// the name of the file used to store the database on disk
	wstring myDBFName;

/// the number of rows returned by the last query on this database
	int myRowCount;				

/// the index number of the last row added
	int myLastID;		

/// the values returned by the last query
	vector<string> myRows;
	vector<wstring> myRows16;

/// if not null, points to last error message
	char * myError;

	CSQLiteDatabase(const wchar_t* dbfname );		// constructor
	~CSQLiteDatabase(void);

/// Query - apply SQL query ( null terminated character string ) to database 
	int Query( const char* szQ ) { return Query( string( szQ ) ); }

///  Query - apply SQL query ( string ) to database.
	int Query( string & sQ );

/// Query - apply SQL query ( unicode CString ) to database
	int Query16( wstring const & q );

///  Enable speed optimization ( synchronous off ).
	void setFast();

protected:

	void Open();
	void Close();

/// sqlite's pointer to the database
	sqlite3 *db;						


private:


	static int RowCount;			// the rows returned by current query on any database

	// callback function used by SQLite each time it returns one row
	static int callback(void *myRows, int argc, char **argv, char **azColName);

};
/**************************************************************************

//   Designed and coded by James Bremner, Raven's Point Consulting,
//   james@ravenspoint.com

  This file is under cvs version control

  If it has been released, the release name will be here: $Name: tip $

  Below is more detailed information describing the precise version

  $Header: C:\Documents and Settings\james\My Documents\code\webem\kenai/src/sqlite/sqlitedatabase.h,v 380e7e273298 2008/09/09 21:28:57 james $

*/

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The BSD License

Share

About the Author

ravenspoint
Founder Raven's Point Consulting
Canada Canada
No Biography provided

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.141216.1 | Last Updated 23 Jun 2014
Article Copyright 2008 by ravenspoint
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid