2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
4 // Licensed under the Apache License, Version 2.0 (the License);
5 // you may not use this file except in compliance with the License.
6 // You may obtain a copy of the License at
8 // http://www.apache.org/licenses/LICENSE-2.0
10 // Unless required by applicable law or agreed to in writing, software
11 // distributed under the License is distributed on an "AS IS" BASIS,
12 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 // See the License for the specific language governing permissions and
14 // limitations under the License.
18 * @file FIo_SecureFile.h
19 * @brief This is the header file for the _SecureFile class.
21 * This header file contains the declarations of the _SecureFile class.
24 #ifndef _FIO_INTERNAL_SECURE_FILE_IMPL_H_
25 #define _FIO_INTERNAL_SECURE_FILE_IMPL_H_
27 #include <FBaseObject.h>
29 #include <FIo_FileImpl.h>
30 #include <FIo_IFileCore.h>
32 namespace Tizen { namespace Base
38 namespace Tizen { namespace Io
42 : public Tizen::Base::Object
47 _SecureFile(bool read, bool write, bool truncate, bool append);
49 result Construct(const Tizen::Base::String& filePath, const char* pOpenMode, const Tizen::Base::ByteBuffer* pSecretKey);
51 virtual ~_SecureFile(void);
53 result Read(Tizen::Base::ByteBuffer& buffer);
55 int Read(void* buffer, int length);
57 result Read(Tizen::Base::String& buffer);
59 result Write(const Tizen::Base::ByteBuffer& buffer);
61 result Write(const void* buffer, int length);
63 result Write(const Tizen::Base::String& buffer);
69 result Seek(FileSeekPosition position, long offset);
71 result Truncate(int length);
73 Tizen::Base::String GetName(void);
75 virtual FILE* GetFilePointer(void)
77 return __pNormalFile->GetFilePointer();
83 _SecureFile(const _SecureFile& source);
85 _SecureFile& operator =(const _SecureFile& source);
87 Tizen::Base::String __filePath;
88 _NormalFile* __pNormalFile;
90 long __virtualFilePointer;
91 Tizen::Base::ByteBuffer* __pKey;
97 #endif // _FIO_INTERNAL_SECURE_FILE_IMPL_H_