Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1299634
  • 博文数量: 436
  • 博客积分: 7854
  • 博客等级: 少将
  • 技术积分: 3225
  • 用 户 组: 普通用户
  • 注册时间: 2007-12-18 16:30
文章分类

全部博文(436)

文章存档

2013年(2)

2012年(56)

2011年(70)

2010年(308)

分类:

2010-07-22 16:40:13

下载地址:
wxSqlite3: 最新的1.9.2已经release出来了……

下载sqlite多文件包版是因为,我们需要添加加密函数实现。

可惜不支持加密,官方发布的 sqlite3 其实有提供函数原型,却没有提供实现。
查看sqlite源代码pager.c ,会发现有几个地方,这个宏 SQLITE_HAS_CODEC 包围了一段代码,这里就是外链加密函数和解密函数的地方。

line 2793: extern void sqlite3pager_free_codecarg(void *);
....(后面还有)

我们需要做的就是,给这个接口添加上实现。

实现很简单,因为wxsqlite3已经做好了~

需要的文件都在下面:wxsqlite3-1.9.2\sqlite3\secure\src

如何实现其实wxsqlite3也有介绍,不过是英文的( line 178 ) :

Optional key based database encryption support
----------------------------------------------

The author of wxSQLite3 has created a key based AES database encryption
implementation for SQLite so that sharing encrypted database files
across different platforms is supported. The implementation is based on
knowledge gained from implementing encryption support for the wxCode
component wxPdfDocument and from inspecting the source code of
System.Data.SQLite. The code implementing this feature is available in
directory sqlite3/secure/src. You may use this code on your own risk.
The subdirectory codec contains the necessary source files; copy the
complete subdirectory to the location where the source code of SQLite
resides on your system. Add the sources in subdirectory codec to the SQLite
makefile and compile SQLite with option SQLITE_HAS_CODEC enabled.

将wxsqlite3-1.9.2\sqlite3\secure\src\pager下面的整个codec目录copy到sqlite目录里。建立一个工程文件,把这些文件都添加到工程内,你也可以直接使用下面的下载文件,不过,责任自负哈。

在 预处理preprocessor 里面设定加上 SQLITE_ENABLE_COLUMN_METADATA;SQLITE_HAS_CODEC 就可以生成sqlite的库了。

完成后,再把sqlite.lib 放到wxSqlite3下面的lib里,现在要编译wxsqlite3库,需要改一下wxsqlite3opt.h文件里面的设定才能编译需要的支持。
简单的把需要的地方从0改成1就可以了。

阅读(706) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~