Merge "Revert "Fix N_SE-46938 for tz list."" into devel_3.0_main
[platform/framework/native/appfw.git] / src / io / inc / FIo_IFileCore.h
1 //
2 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
3 //
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
7 //
8 //     http://www.apache.org/licenses/LICENSE-2.0
9 //
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.
15 //
16
17 /**
18  * @file        FIo_IFileCore.h
19  * @brief       This is the header file for the _IFileCore class.
20  *
21  * This header file contains the declarations of the %_IFileCore class.
22  */
23
24 #ifndef _FIO_INTERNAL_IFILECORE_H_
25 #define _FIO_INTERNAL_IFILECORE_H_
26
27 #include <FBaseString.h>
28 #include <FBaseByteBuffer.h>
29 #include <FBaseResult.h>
30
31 namespace Tizen { namespace Io
32 {
33
34 class _IFileCore
35 {
36
37 public:
38         _IFileCore(void)
39         : _read(false)
40         , _write(false)
41         , _truncate(false)
42         , _append(false)
43         {}
44
45         virtual ~_IFileCore(void) {}
46
47         virtual result Read(Tizen::Base::ByteBuffer& buffer) = 0;
48
49         virtual int Read(void* buffer, int length) = 0;
50
51         virtual result Read(Tizen::Base::String& buffer) = 0;
52
53         virtual result Write(const Tizen::Base::ByteBuffer& buffer) = 0;
54
55         virtual result Write(const void* buffer, int length) = 0;
56
57         virtual result Write(const Tizen::Base::String& buffer) = 0;
58
59         virtual result Flush(void) = 0;
60
61         virtual int Tell(void) const = 0;
62
63         virtual result Seek(FileSeekPosition position, long offset) = 0;
64
65         virtual result Truncate(int length) = 0;
66
67         virtual Tizen::Base::String GetName(void) = 0;
68
69         virtual FILE* GetFilePointer(void) = 0;
70
71 protected:
72         bool _read;
73         bool _write;
74         bool _truncate;
75         bool _append;
76
77 }; // _IFileCore
78
79 }} // Tizen::Io
80
81 #endif // _FIO_INTERNAL_IFILECORE_H_
82