Update of /cvsroot/gcblue/gcb_wx/include/sqlite
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21227/include/sqlite
Added Files:
sqlite_internal.h sqlite_plus.h
Log Message:
--- NEW FILE: sqlite_plus.h ---
/*
Copyright (c) 2004 Cory Nelson
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef __SQLITE_PLUS_H__
#define __SQLITE_PLUS_H__
#include <string>
#include <cstdarg>
namespace sqlite {
class connection {
private:
void *internal;
class reader executereader(const char *fmt, va_list args);
public:
connection();
connection(const char *db);
~connection();
void open(const char *db);
void close();
int insertid();
int executenonquery(const char *fmt, ...);
std::string executescalar(const char *fmt, ...);
class reader executereader(const char *fmt, ...);
};
class reader {
friend connection;
private:
void *vm;
int argc;
const char **argv;
public:
reader();
bool read();
void close();
int GetFieldCount() {return argc;}
int getint(int index);
double getdouble(int index);
std::string getstring(int index);
std::string operator[](int index);
};
};
#endif
--- NEW FILE: sqlite_internal.h ---
/*
Copyright (c) 2004 Cory Nelson
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef __SQLITE_PLUS_INTERNAL_H__
#define __SQLITE_PLUS_INTERNAL_H__
#include <cstdarg>
#ifndef SQLITE_OK
#define SQLITE_OK 0
#endif
#ifndef SQLITE_ROW
#define SQLITE_ROW 100
#endif
#ifndef SQLITE_DONE
#define SQLITE_DONE 101
#endif
void *_sqlite_open(const char *db);
void _sqlite_close(void *db);
int _sqlite_compile(void *db, const char *sql, void **vm);
int _sqlite_step(void *vm, int *argc, const char ***argv);
int _sqlite_finalize(void *vm);
int _sqlite_last_insert_rowid(void *db);
int _sqlite_changes(void *db);
char *_sqlite_vmprintf(const char *fmt, va_list args);
void _sqlite_freemem(char *str);
const char *_sqlite_error_string(int err);
#endif
|