示例#1
0
文件: SqlDir.cs 项目: thelan/sqlitefs
        public virtual SqlFile addFile(string fileName)
        {
            SqlFsErrCode.CurrentError = FsErr.OK;

            SqlFile newFile = null;

            fsLocker.FsLock;
            SqlFsTransaction fsTran = new SqlFsTransaction(db);

            try
            {
                newFile = __addFile(fileName);
                if (newFile != null)
                {
                    fsTran.fsOpSuccess();
                }
            }
            finally
            {
                fsTran.dispose();
                fsLocker.dispose();
            }

            return(newFile);
        }
示例#2
0
文件: SqlDir.cs 项目: thelan/sqlitefs
        public override bool delete()
        {
            SqlFsErrCode.CurrentError = FsErr.OK;

            bool isOK = false;

            fsLocker.FsLock;
            SqlFsTransaction fsTran = new SqlFsTransaction(db);

            try
            {
                isOK = __delete();
                if (isOK)
                {
                    fsTran.fsOpSuccess();
                }
            }
            finally
            {
                fsTran.dispose();
                fsLocker.dispose();
            }

            return(isOK);
        }
示例#3
0
文件: SqlDir.cs 项目: thelan/sqlitefs
        public virtual SqlDir addDir(string dirName)
        {
            SqlFsErrCode.CurrentError = FsErr.OK;

            SqlDir childDir = null;

            fsLocker.FsLock;
            SqlFsTransaction fsTran = new SqlFsTransaction(db);

            try
            {
                childDir = __addDir(dirName);
                if (childDir != null)
                {
                    fsTran.fsOpSuccess();
                }
            }
            finally
            {
                fsTran.dispose();
                fsLocker.dispose();
            }

            return(childDir);
        }
示例#4
0
        public virtual bool saveFileData(IFileData fileData)
        {
            SqlFsErrCode.CurrentError = FsErr.OK;

            bool isOK = false;

            fsLocker.FsLock;
            SqlFsTransaction fsTran = new SqlFsTransaction(db);

            try
            {
                isOK = __saveFileData(fileData);
                if (isOK)
                {
                    fsTran.fsOpSuccess();
                }
            }
            finally
            {
                fsTran.dispose();
                fsLocker.dispose();
            }

            return(isOK);
        }
示例#5
0
        public virtual bool move(SqlDir destDir)
        {
            SqlFsErrCode.CurrentError = FsErr.OK;

            bool isOK = false;

            fsLocker.FsLock;
            SqlFsTransaction fsTran = new SqlFsTransaction(db);

            try
            {
                isOK = __move(destDir);
                if (isOK)
                {
                    fsTran.fsOpSuccess();
                }
            }
            finally
            {
                fsTran.dispose();
                fsLocker.dispose();
            }

            return(isOK);
        }
示例#6
0
        public virtual bool rename(string newName)
        {
            SqlFsErrCode.CurrentError = FsErr.OK;

            bool isOK = false;

            fsLocker.FsLock;
            SqlFsTransaction fsTran = new SqlFsTransaction(db);

            try
            {
                isOK = __rename(newName);
                if (isOK)
                {
                    fsTran.fsOpSuccess();
                }
            }
            finally
            {
                fsTran.dispose();
                fsLocker.dispose();
            }

            return(isOK);
        }
示例#7
0
        public virtual void writeInfo(string infoName, string infoVal)
        {
            SqlFsErrCode.CurrentError = FsErr.OK;

            fsLocker.FsLock;
            SqlFsTransaction fsTran = new SqlFsTransaction(db);

            try
            {
                __writeInfo(infoName, infoVal);
                fsTran.fsOpSuccess();
            }
            catch (SQLiteException)
            {
            }
            finally
            {
                fsTran.dispose();
                fsLocker.dispose();
            }
        }