Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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();
            }
        }