/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- * vim: sw=2 ts=2 et lcs=trail\:.,tab\:>~ : * This Source Code Form is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
/** * This VFS is built on top of the (unix|win32)-none, but it additionally * sets any opened file as immutable, that allows to also open in read-only * mode databases using WAL, or other journals that need auxiliary files, when * such files cannot be created. * This is useful when trying to read from third-party databases, avoiding any * risk of creating auxiliary files (e.g. journals). * It can only be used on read-only connections, because being a no-lock VFS * it would be trivial to corrupt the data.
*/
staticint vfsOpen(sqlite3_vfs* vfs, constchar* zName, sqlite3_file* pFile, int flags, int* pOutFlags) { if ((flags & SQLITE_OPEN_READONLY) == 0) { // This is not done to be used in readwrite connections. return SQLITE_CANTOPEN;
}
sqlite3_vfs* pOrigVfs = ORIGVFS(vfs); int rc = pOrigVfs->xOpen(pOrigVfs, zName, pFile, flags, pOutFlags); if (rc != SQLITE_OK) { return rc;
}
// If the IO version is higher than the last known one, you should update // this IO adding appropriate methods for any methods added in the version // change.
MOZ_ASSERT(pOrigMethods->iVersion <= 3);
// If the VFS version is higher than the last known one, you should update // this VFS adding appropriate methods for any methods added in the version // change.
MOZ_ASSERT(pOrigVfs->iVersion <= 3);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung ist noch experimentell.