Merge "Revert "Fix N_SE-46938 for tz list."" into devel_3.0_main
[platform/framework/native/appfw.git] / src / io / inc / FIo_NormalFile.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_NormalFile.h
19  * @brief       This is the header file for the _NormalFile class.
20  *
21  * This header file contains the declarations of the %_NormalFile class.
22  */
23
24 #ifndef _FIO_INTERNAL_NORMALFILE_H_
25 #define _FIO_INTERNAL_NORMALFILE_H_
26
27 #include <FBaseInternalTypes.h>
28 #include <FBaseString.h>
29 #include <FBaseByteBuffer.h>
30 #include <FBaseDateTime.h>
31 #include <FBaseColIList.h>
32 #include <FBaseResult.h>
33 #include <FIoFile.h>
34
35 #include <FIo_FileImpl.h>
36 #include <FIo_IFileCore.h>
37
38 namespace Tizen { namespace Io
39 {
40
41 class _NormalFile
42         : public Tizen::Base::Object
43         , public _IFileCore
44 {
45
46 public:
47         _NormalFile(void);
48
49         result Construct(const Tizen::Base::String& filePath, const char* pOpenMode);
50
51         virtual ~_NormalFile(void);
52
53         result Read(Tizen::Base::ByteBuffer& buffer);
54
55         int Read(void* buffer, int length);
56
57         result Read(Tizen::Base::String& buffer);
58
59         result ReadN(char** buffer, int& length);
60
61         result Write(const Tizen::Base::ByteBuffer& buffer);
62
63         result Write(const void* buffer, int length);
64
65         result Write(const Tizen::Base::String& buffer);
66
67         result Flush(void);
68
69         int Tell(void) const;
70
71         result Seek(FileSeekPosition position, long offset);
72
73         result Truncate(int length);
74
75         Tizen::Base::String GetName(void);
76
77         virtual FILE* GetFilePointer(void)
78         {
79                 return __pFile;
80         }
81
82 private:
83         Tizen::Base::String __filePath;
84
85         FILE* __pFile;
86
87 }; // _NormalFile
88
89 }} // Tizen::Io
90
91 #endif // _FIO_INTERNAL_NORMALFILE_H_
92