Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(342)

Side by Side Diff: xfa/src/fgas/src/crt/fx_stream.h

Issue 1172793002: Merge to XFA: Use stdint.h types throughout PDFium. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@xfa
Patch Set: Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « xfa/src/fgas/src/crt/fx_memory.cpp ('k') | xfa/src/fgas/src/crt/fx_stream.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #ifndef _FX_STREAM_IMP 7 #ifndef _FX_STREAM_IMP
8 #define _FX_STREAM_IMP 8 #define _FX_STREAM_IMP
9 class CFX_StreamImp; 9 class CFX_StreamImp;
10 class CFX_FileStreamImp; 10 class CFX_FileStreamImp;
(...skipping 10 matching lines...) Expand all
21 { 21 {
22 public: 22 public:
23 virtual void Release() 23 virtual void Release()
24 { 24 {
25 delete this; 25 delete this;
26 } 26 }
27 virtual FX_DWORD GetAccessModes() const 27 virtual FX_DWORD GetAccessModes() const
28 { 28 {
29 return m_dwAccess; 29 return m_dwAccess;
30 } 30 }
31 virtual FX_INT32» » GetLength() const = 0; 31 virtual int32_t» » GetLength() const = 0;
32 virtual FX_INT32» » Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset) = 0; 32 virtual int32_t» » Seek(FX_STREAMSEEK eSeek, int32_t iOffset) = 0;
33 virtual FX_INT32» » GetPosition() = 0; 33 virtual int32_t» » GetPosition() = 0;
34 virtual FX_BOOL IsEOF() const = 0; 34 virtual FX_BOOL IsEOF() const = 0;
35 virtual FX_INT32» » ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize ) = 0; 35 virtual int32_t» » ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize) = 0;
36 virtual FX_INT32» » ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS) = 0; 36 virtual int32_t» » ReadString(FX_LPWSTR pStr, int32_t iMaxLength, F X_BOOL &bEOS) = 0;
37 virtual FX_INT32» » WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSi ze) = 0; 37 virtual int32_t» » WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSiz e) = 0;
38 virtual FX_INT32» » WriteString(FX_LPCWSTR pStr, FX_INT32 iLength) = 0; 38 virtual int32_t» » WriteString(FX_LPCWSTR pStr, int32_t iLength) = 0;
39 virtual void Flush() = 0; 39 virtual void Flush() = 0;
40 virtual FX_BOOL» » » SetLength(FX_INT32 iLength) = 0; 40 virtual FX_BOOL» » » SetLength(int32_t iLength) = 0;
41 protected: 41 protected:
42 CFX_StreamImp(); 42 CFX_StreamImp();
43 virtual ~CFX_StreamImp() {} 43 virtual ~CFX_StreamImp() {}
44 FX_DWORD m_dwAccess; 44 FX_DWORD m_dwAccess;
45 }; 45 };
46 class CFX_FileStreamImp : public CFX_StreamImp 46 class CFX_FileStreamImp : public CFX_StreamImp
47 { 47 {
48 public: 48 public:
49 CFX_FileStreamImp(); 49 CFX_FileStreamImp();
50 virtual ~CFX_FileStreamImp(); 50 virtual ~CFX_FileStreamImp();
51 FX_BOOL LoadFile(FX_LPCWSTR pszSrcFileName, FX_DWORD dwA ccess); 51 FX_BOOL LoadFile(FX_LPCWSTR pszSrcFileName, FX_DWORD dwA ccess);
52 virtual FX_INT32» » GetLength() const; 52 virtual int32_t» » GetLength() const;
53 virtual FX_INT32» » Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset); 53 virtual int32_t» » Seek(FX_STREAMSEEK eSeek, int32_t iOffset);
54 virtual FX_INT32» » GetPosition(); 54 virtual int32_t» » GetPosition();
55 virtual FX_BOOL IsEOF() const; 55 virtual FX_BOOL IsEOF() const;
56 virtual FX_INT32» » ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize ); 56 virtual int32_t» » ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize) ;
57 virtual FX_INT32» » ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS); 57 virtual int32_t» » ReadString(FX_LPWSTR pStr, int32_t iMaxLength, F X_BOOL &bEOS);
58 virtual FX_INT32» » WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSi ze); 58 virtual int32_t» » WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSiz e);
59 virtual FX_INT32» » WriteString(FX_LPCWSTR pStr, FX_INT32 iLength); 59 virtual int32_t» » WriteString(FX_LPCWSTR pStr, int32_t iLength);
60 virtual void Flush(); 60 virtual void Flush();
61 virtual FX_BOOL» » » SetLength(FX_INT32 iLength); 61 virtual FX_BOOL» » » SetLength(int32_t iLength);
62 protected: 62 protected:
63 FXSYS_FILE *m_hFile; 63 FXSYS_FILE *m_hFile;
64 FX_INT32» m_iLength; 64 int32_t» m_iLength;
65 }; 65 };
66 class CFX_BufferStreamImp : public CFX_StreamImp 66 class CFX_BufferStreamImp : public CFX_StreamImp
67 { 67 {
68 public: 68 public:
69 CFX_BufferStreamImp(); 69 CFX_BufferStreamImp();
70 virtual ~CFX_BufferStreamImp() {} 70 virtual ~CFX_BufferStreamImp() {}
71 FX_BOOL» » » LoadBuffer(FX_LPBYTE pData, FX_INT32 iTotalSize, FX_DWORD dwAccess); 71 FX_BOOL» » » LoadBuffer(FX_LPBYTE pData, int32_t iTotalSize, FX_DWORD dwAccess);
72 virtual FX_INT32» » GetLength() const; 72 virtual int32_t» » GetLength() const;
73 virtual FX_INT32» » Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset); 73 virtual int32_t» » Seek(FX_STREAMSEEK eSeek, int32_t iOffset);
74 virtual FX_INT32» » GetPosition(); 74 virtual int32_t» » GetPosition();
75 virtual FX_BOOL IsEOF() const; 75 virtual FX_BOOL IsEOF() const;
76 virtual FX_INT32» » ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize ); 76 virtual int32_t» » ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize) ;
77 virtual FX_INT32» » ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS); 77 virtual int32_t» » ReadString(FX_LPWSTR pStr, int32_t iMaxLength, F X_BOOL &bEOS);
78 virtual FX_INT32» » WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSi ze); 78 virtual int32_t» » WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSiz e);
79 virtual FX_INT32» » WriteString(FX_LPCWSTR pStr, FX_INT32 iLength); 79 virtual int32_t» » WriteString(FX_LPCWSTR pStr, int32_t iLength);
80 virtual void Flush() {} 80 virtual void Flush() {}
81 virtual FX_BOOL» » » SetLength(FX_INT32 iLength) 81 virtual FX_BOOL» » » SetLength(int32_t iLength)
82 { 82 {
83 return FALSE; 83 return FALSE;
84 } 84 }
85 protected: 85 protected:
86 FX_LPBYTE m_pData; 86 FX_LPBYTE m_pData;
87 FX_INT32» m_iTotalSize; 87 int32_t» m_iTotalSize;
88 FX_INT32» m_iPosition; 88 int32_t» m_iPosition;
89 FX_INT32» m_iLength; 89 int32_t» m_iLength;
90 }; 90 };
91 class CFX_FileReadStreamImp : public CFX_StreamImp 91 class CFX_FileReadStreamImp : public CFX_StreamImp
92 { 92 {
93 public: 93 public:
94 CFX_FileReadStreamImp(); 94 CFX_FileReadStreamImp();
95 virtual ~CFX_FileReadStreamImp() {} 95 virtual ~CFX_FileReadStreamImp() {}
96 FX_BOOL LoadFileRead(IFX_FileRead *pFileRead, FX_DWORD d wAccess); 96 FX_BOOL LoadFileRead(IFX_FileRead *pFileRead, FX_DWORD d wAccess);
97 virtual FX_INT32» » GetLength() const; 97 virtual int32_t» » GetLength() const;
98 virtual FX_INT32» » Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset); 98 virtual int32_t» » Seek(FX_STREAMSEEK eSeek, int32_t iOffset);
99 virtual FX_INT32» » GetPosition() 99 virtual int32_t» » GetPosition()
100 { 100 {
101 return m_iPosition; 101 return m_iPosition;
102 } 102 }
103 virtual FX_BOOL IsEOF() const; 103 virtual FX_BOOL IsEOF() const;
104 104
105 virtual FX_INT32» » ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize ); 105 virtual int32_t» » ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize) ;
106 virtual FX_INT32» » ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS); 106 virtual int32_t» » ReadString(FX_LPWSTR pStr, int32_t iMaxLength, F X_BOOL &bEOS);
107 virtual FX_INT32» » WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSi ze) 107 virtual int32_t» » WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSiz e)
108 { 108 {
109 return 0; 109 return 0;
110 } 110 }
111 virtual FX_INT32» » WriteString(FX_LPCWSTR pStr, FX_INT32 iLength) 111 virtual int32_t» » WriteString(FX_LPCWSTR pStr, int32_t iLength)
112 { 112 {
113 return 0; 113 return 0;
114 } 114 }
115 virtual void Flush() {} 115 virtual void Flush() {}
116 virtual FX_BOOL» » » SetLength(FX_INT32 iLength) 116 virtual FX_BOOL» » » SetLength(int32_t iLength)
117 { 117 {
118 return FALSE; 118 return FALSE;
119 } 119 }
120 protected: 120 protected:
121 IFX_FileRead *m_pFileRead; 121 IFX_FileRead *m_pFileRead;
122 FX_INT32» » » » m_iPosition; 122 int32_t» » » » m_iPosition;
123 FX_INT32» » » » m_iLength; 123 int32_t» » » » m_iLength;
124 }; 124 };
125 class CFX_BufferReadStreamImp : public CFX_StreamImp 125 class CFX_BufferReadStreamImp : public CFX_StreamImp
126 { 126 {
127 public: 127 public:
128 CFX_BufferReadStreamImp(); 128 CFX_BufferReadStreamImp();
129 ~CFX_BufferReadStreamImp(); 129 ~CFX_BufferReadStreamImp();
130 FX_BOOL» » » LoadBufferRead(IFX_BufferRead *pBufferRead, FX_I NT32 iFileSize, FX_DWORD dwAccess, FX_BOOL bReleaseBufferRead); 130 FX_BOOL» » » LoadBufferRead(IFX_BufferRead *pBufferRead, int3 2_t iFileSize, FX_DWORD dwAccess, FX_BOOL bReleaseBufferRead);
131 131
132 virtual FX_INT32» » GetLength() const; 132 virtual int32_t» » GetLength() const;
133 virtual FX_INT32» » Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset); 133 virtual int32_t» » Seek(FX_STREAMSEEK eSeek, int32_t iOffset);
134 virtual FX_INT32» » GetPosition() 134 virtual int32_t» » GetPosition()
135 { 135 {
136 return m_iPosition; 136 return m_iPosition;
137 } 137 }
138 virtual FX_BOOL IsEOF() const; 138 virtual FX_BOOL IsEOF() const;
139 139
140 virtual FX_INT32» » ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize ); 140 virtual int32_t» » ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize) ;
141 virtual FX_INT32» » ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS); 141 virtual int32_t» » ReadString(FX_LPWSTR pStr, int32_t iMaxLength, F X_BOOL &bEOS);
142 virtual FX_INT32» » WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSi ze) 142 virtual int32_t» » WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSiz e)
143 { 143 {
144 return 0; 144 return 0;
145 } 145 }
146 virtual FX_INT32» » WriteString(FX_LPCWSTR pStr, FX_INT32 iLength) 146 virtual int32_t» » WriteString(FX_LPCWSTR pStr, int32_t iLength)
147 { 147 {
148 return 0; 148 return 0;
149 } 149 }
150 virtual void Flush() {} 150 virtual void Flush() {}
151 virtual FX_BOOL» » » SetLength(FX_INT32 iLength) 151 virtual FX_BOOL» » » SetLength(int32_t iLength)
152 { 152 {
153 return FALSE; 153 return FALSE;
154 } 154 }
155 private: 155 private:
156 IFX_BufferRead *m_pBufferRead; 156 IFX_BufferRead *m_pBufferRead;
157 FX_BOOL m_bReleaseBufferRead; 157 FX_BOOL m_bReleaseBufferRead;
158 FX_INT32» » » » m_iPosition; 158 int32_t» » » » m_iPosition;
159 FX_INT32» » » » m_iBufferSize; 159 int32_t» » » » m_iBufferSize;
160 }; 160 };
161 class CFX_FileWriteStreamImp : public CFX_StreamImp 161 class CFX_FileWriteStreamImp : public CFX_StreamImp
162 { 162 {
163 public: 163 public:
164 CFX_FileWriteStreamImp(); 164 CFX_FileWriteStreamImp();
165 virtual ~CFX_FileWriteStreamImp() {} 165 virtual ~CFX_FileWriteStreamImp() {}
166 FX_BOOL LoadFileWrite(IFX_FileWrite *pFileWrite, FX_DWOR D dwAccess); 166 FX_BOOL LoadFileWrite(IFX_FileWrite *pFileWrite, FX_DWOR D dwAccess);
167 virtual FX_INT32» » GetLength() const; 167 virtual int32_t» » GetLength() const;
168 virtual FX_INT32» » Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset); 168 virtual int32_t» » Seek(FX_STREAMSEEK eSeek, int32_t iOffset);
169 virtual FX_INT32» » GetPosition() 169 virtual int32_t» » GetPosition()
170 { 170 {
171 return m_iPosition; 171 return m_iPosition;
172 } 172 }
173 virtual FX_BOOL IsEOF() const; 173 virtual FX_BOOL IsEOF() const;
174 virtual FX_INT32» » ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize ) 174 virtual int32_t» » ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize)
175 { 175 {
176 return 0; 176 return 0;
177 } 177 }
178 virtual FX_INT32» » ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS) 178 virtual int32_t» » ReadString(FX_LPWSTR pStr, int32_t iMaxLength, F X_BOOL &bEOS)
179 { 179 {
180 return 0; 180 return 0;
181 } 181 }
182 virtual FX_INT32» » WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSi ze); 182 virtual int32_t» » WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSiz e);
183 virtual FX_INT32» » WriteString(FX_LPCWSTR pStr, FX_INT32 iLength); 183 virtual int32_t» » WriteString(FX_LPCWSTR pStr, int32_t iLength);
184 virtual void Flush(); 184 virtual void Flush();
185 virtual FX_BOOL» » » SetLength(FX_INT32 iLength) 185 virtual FX_BOOL» » » SetLength(int32_t iLength)
186 { 186 {
187 return FALSE; 187 return FALSE;
188 } 188 }
189 protected: 189 protected:
190 IFX_FileWrite *m_pFileWrite; 190 IFX_FileWrite *m_pFileWrite;
191 FX_INT32» » » » m_iPosition; 191 int32_t» » » » m_iPosition;
192 }; 192 };
193 enum FX_STREAMTYPE { 193 enum FX_STREAMTYPE {
194 FX_SREAMTYPE_Unknown = 0, 194 FX_SREAMTYPE_Unknown = 0,
195 FX_STREAMTYPE_File , 195 FX_STREAMTYPE_File ,
196 FX_STREAMTYPE_Buffer , 196 FX_STREAMTYPE_Buffer ,
197 FX_STREAMTYPE_Stream , 197 FX_STREAMTYPE_Stream ,
198 FX_STREAMTYPE_BufferRead , 198 FX_STREAMTYPE_BufferRead ,
199 }; 199 };
200 class CFX_Stream : public IFX_Stream, public CFX_ThreadLock 200 class CFX_Stream : public IFX_Stream, public CFX_ThreadLock
201 { 201 {
202 public: 202 public:
203 CFX_Stream(); 203 CFX_Stream();
204 ~CFX_Stream(); 204 ~CFX_Stream();
205 FX_BOOL LoadFile(FX_LPCWSTR pszSrcFileName, FX_DWORD dwA ccess); 205 FX_BOOL LoadFile(FX_LPCWSTR pszSrcFileName, FX_DWORD dwA ccess);
206 FX_BOOL» » » LoadBuffer(FX_LPBYTE pData, FX_INT32 iTotalSize, FX_DWORD dwAccess); 206 FX_BOOL» » » LoadBuffer(FX_LPBYTE pData, int32_t iTotalSize, FX_DWORD dwAccess);
207 FX_BOOL LoadFileRead(IFX_FileRead *pFileRead, FX_DWORD d wAccess); 207 FX_BOOL LoadFileRead(IFX_FileRead *pFileRead, FX_DWORD d wAccess);
208 FX_BOOL LoadFileWrite(IFX_FileWrite *pFileWrite, FX_DWOR D dwAccess); 208 FX_BOOL LoadFileWrite(IFX_FileWrite *pFileWrite, FX_DWOR D dwAccess);
209 FX_BOOL» » » LoadBufferRead(IFX_BufferRead *pBufferRead, FX_I NT32 iFileSize, FX_DWORD dwAccess, FX_BOOL bReleaseBufferRead); 209 FX_BOOL» » » LoadBufferRead(IFX_BufferRead *pBufferRead, int3 2_t iFileSize, FX_DWORD dwAccess, FX_BOOL bReleaseBufferRead);
210 virtual void Release(); 210 virtual void Release();
211 virtual IFX_Stream* Retain(); 211 virtual IFX_Stream* Retain();
212 virtual FX_DWORD GetAccessModes() const 212 virtual FX_DWORD GetAccessModes() const
213 { 213 {
214 return m_dwAccess; 214 return m_dwAccess;
215 } 215 }
216 virtual FX_INT32» » GetLength() const; 216 virtual int32_t» » GetLength() const;
217 virtual FX_INT32» » Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffset); 217 virtual int32_t» » Seek(FX_STREAMSEEK eSeek, int32_t iOffset);
218 virtual FX_INT32» » GetPosition(); 218 virtual int32_t» » GetPosition();
219 virtual FX_BOOL IsEOF() const; 219 virtual FX_BOOL IsEOF() const;
220 virtual FX_INT32» » ReadData(FX_LPBYTE pBuffer, FX_INT32 iBufferSize ); 220 virtual int32_t» » ReadData(FX_LPBYTE pBuffer, int32_t iBufferSize) ;
221 virtual FX_INT32» » ReadString(FX_LPWSTR pStr, FX_INT32 iMaxLength, FX_BOOL &bEOS, FX_INT32 const *pByteSize = NULL); 221 virtual int32_t» » ReadString(FX_LPWSTR pStr, int32_t iMaxLength, F X_BOOL &bEOS, int32_t const *pByteSize = NULL);
222 virtual FX_INT32» » WriteData(FX_LPCBYTE pBuffer, FX_INT32 iBufferSi ze); 222 virtual int32_t» » WriteData(FX_LPCBYTE pBuffer, int32_t iBufferSiz e);
223 virtual FX_INT32» » WriteString(FX_LPCWSTR pStr, FX_INT32 iLength); 223 virtual int32_t» » WriteString(FX_LPCWSTR pStr, int32_t iLength);
224 virtual void Flush(); 224 virtual void Flush();
225 virtual FX_BOOL» » » SetLength(FX_INT32 iLength); 225 virtual FX_BOOL» » » SetLength(int32_t iLength);
226 virtual FX_INT32» » GetBOM(FX_BYTE bom[4]) const; 226 virtual int32_t» » GetBOM(uint8_t bom[4]) const;
227 virtual FX_WORD GetCodePage() const; 227 virtual FX_WORD GetCodePage() const;
228 virtual FX_WORD SetCodePage(FX_WORD wCodePage); 228 virtual FX_WORD SetCodePage(FX_WORD wCodePage);
229 virtual void Lock() 229 virtual void Lock()
230 { 230 {
231 CFX_ThreadLock::Lock(); 231 CFX_ThreadLock::Lock();
232 } 232 }
233 virtual void Unlock() 233 virtual void Unlock()
234 { 234 {
235 CFX_ThreadLock::Unlock(); 235 CFX_ThreadLock::Unlock();
236 } 236 }
237 virtual IFX_Stream*»» CreateSharedStream(FX_DWORD dwAccess, FX_INT32 i Offset, FX_INT32 iLength); 237 virtual IFX_Stream*»» CreateSharedStream(FX_DWORD dwAccess, int32_t iO ffset, int32_t iLength);
238 protected: 238 protected:
239 FX_STREAMTYPE m_eStreamType; 239 FX_STREAMTYPE m_eStreamType;
240 CFX_StreamImp *m_pStreamImp; 240 CFX_StreamImp *m_pStreamImp;
241 FX_DWORD m_dwAccess; 241 FX_DWORD m_dwAccess;
242 FX_INT32» » » » m_iTotalSize; 242 int32_t» » » » m_iTotalSize;
243 FX_INT32» » » » m_iPosition; 243 int32_t» » » » m_iPosition;
244 FX_INT32» » » » m_iStart; 244 int32_t» » » » m_iStart;
245 FX_INT32» » » » m_iLength; 245 int32_t» » » » m_iLength;
246 FX_INT32» » » » m_iRefCount; 246 int32_t» » » » m_iRefCount;
247 }; 247 };
248 class CFX_TextStream : public IFX_Stream, public CFX_ThreadLock 248 class CFX_TextStream : public IFX_Stream, public CFX_ThreadLock
249 { 249 {
250 public: 250 public:
251 CFX_TextStream(IFX_Stream *pStream, FX_BOOL bDelStream); 251 CFX_TextStream(IFX_Stream *pStream, FX_BOOL bDelStream);
252 ~CFX_TextStream(); 252 ~CFX_TextStream();
253 virtual void Release(); 253 virtual void Release();
254 virtual IFX_Stream* Retain(); 254 virtual IFX_Stream* Retain();
255 255
256 virtual FX_DWORD GetAccessModes() const; 256 virtual FX_DWORD GetAccessModes() const;
257 virtual FX_INT32» » » GetLength() const; 257 virtual int32_t» » » GetLength() const;
258 virtual FX_INT32» » » Seek(FX_STREAMSEEK eSeek, FX_INT32 iOffs et); 258 virtual int32_t» » » Seek(FX_STREAMSEEK eSeek, int32_t iOffse t);
259 virtual FX_INT32» » » GetPosition(); 259 virtual int32_t» » » GetPosition();
260 virtual FX_BOOL IsEOF() const; 260 virtual FX_BOOL IsEOF() const;
261 261
262 virtual FX_INT32» » » ReadData(FX_LPBYTE pBuffer, FX_INT32 iBu fferSize); 262 virtual int32_t» » » ReadData(FX_LPBYTE pBuffer, int32_t iBuf ferSize);
263 virtual FX_INT32» » » ReadString(FX_LPWSTR pStr, FX_INT32 iMax Length, FX_BOOL &bEOS, FX_INT32 const *pByteSize = NULL); 263 virtual int32_t» » » ReadString(FX_LPWSTR pStr, int32_t iMaxL ength, FX_BOOL &bEOS, int32_t const *pByteSize = NULL);
264 virtual FX_INT32» » » WriteData(FX_LPCBYTE pBuffer, FX_INT32 i BufferSize); 264 virtual int32_t» » » WriteData(FX_LPCBYTE pBuffer, int32_t iB ufferSize);
265 virtual FX_INT32» » » WriteString(FX_LPCWSTR pStr, FX_INT32 iL ength); 265 virtual int32_t» » » WriteString(FX_LPCWSTR pStr, int32_t iLe ngth);
266 virtual void Flush(); 266 virtual void Flush();
267 virtual FX_BOOL» » » » SetLength(FX_INT32 iLength); 267 virtual FX_BOOL» » » » SetLength(int32_t iLength);
268 268
269 virtual FX_INT32» » » GetBOM(FX_BYTE bom[4]) const; 269 virtual int32_t» » » GetBOM(uint8_t bom[4]) const;
270 virtual FX_WORD GetCodePage() const; 270 virtual FX_WORD GetCodePage() const;
271 virtual FX_WORD SetCodePage(FX_WORD wCodePage); 271 virtual FX_WORD SetCodePage(FX_WORD wCodePage);
272 272
273 virtual void Lock() 273 virtual void Lock()
274 { 274 {
275 CFX_ThreadLock::Lock(); 275 CFX_ThreadLock::Lock();
276 } 276 }
277 virtual void Unlock() 277 virtual void Unlock()
278 { 278 {
279 CFX_ThreadLock::Unlock(); 279 CFX_ThreadLock::Unlock();
280 } 280 }
281 281
282 virtual IFX_Stream*»» » CreateSharedStream(FX_DWORD dwAccess, FX _INT32 iOffset, FX_INT32 iLength); 282 virtual IFX_Stream*»» » CreateSharedStream(FX_DWORD dwAccess, in t32_t iOffset, int32_t iLength);
283 protected: 283 protected:
284 FX_WORD m_wCodePage; 284 FX_WORD m_wCodePage;
285 FX_WORD m_wBOMLength; 285 FX_WORD m_wBOMLength;
286 FX_DWORD m_dwBOM; 286 FX_DWORD m_dwBOM;
287 FX_LPBYTE m_pBuf; 287 FX_LPBYTE m_pBuf;
288 FX_INT32» m_iBufSize; 288 int32_t» m_iBufSize;
289 FX_BOOL m_bDelStream; 289 FX_BOOL m_bDelStream;
290 IFX_Stream *m_pStreamImp; 290 IFX_Stream *m_pStreamImp;
291 FX_INT32» m_iRefCount; 291 int32_t» m_iRefCount;
292 void InitStream(); 292 void InitStream();
293 }; 293 };
294 #ifdef FX_FILESIZE 294 #ifdef FX_FILESIZE
295 class CFGAS_FileRead : public IFX_FileRead 295 class CFGAS_FileRead : public IFX_FileRead
296 { 296 {
297 public: 297 public:
298 CFGAS_FileRead(IFX_Stream *pStream, FX_BOOL bReleaseStream); 298 CFGAS_FileRead(IFX_Stream *pStream, FX_BOOL bReleaseStream);
299 virtual ~CFGAS_FileRead(); 299 virtual ~CFGAS_FileRead();
300 virtual void Release() 300 virtual void Release()
301 { 301 {
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
340 virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offs et, size_t size); 340 virtual FX_BOOL ReadBlock(void* buffer, FX_FILESIZE offs et, size_t size);
341 protected: 341 protected:
342 IFX_BufferRead *m_pBufferRead; 342 IFX_BufferRead *m_pBufferRead;
343 FX_BOOL m_bReleaseStream; 343 FX_BOOL m_bReleaseStream;
344 FX_FILESIZE m_iBufSize; 344 FX_FILESIZE m_iBufSize;
345 }; 345 };
346 #else 346 #else
347 class CFX_BufferAccImp : public IFX_FileRead 347 class CFX_BufferAccImp : public IFX_FileRead
348 { 348 {
349 public: 349 public:
350 CFX_BufferAccImp(IFX_BufferRead *pBufferRead, FX_INT32 iFileSize, FX_BOOL bR eleaseStream); 350 CFX_BufferAccImp(IFX_BufferRead *pBufferRead, int32_t iFileSize, FX_BOOL bRe leaseStream);
351 virtual ~CFX_BufferAccImp(); 351 virtual ~CFX_BufferAccImp();
352 352
353 virtual void Release() 353 virtual void Release()
354 { 354 {
355 delete this; 355 delete this;
356 } 356 }
357 virtual FX_DWORD GetSize(); 357 virtual FX_DWORD GetSize();
358 virtual FX_BOOL ReadBlock(void* buffer, FX_DWORD offset, FX_DWORD size); 358 virtual FX_BOOL ReadBlock(void* buffer, FX_DWORD offset, FX_DWORD size);
359 359
360 protected: 360 protected:
361 IFX_BufferRead *m_pBufferRead; 361 IFX_BufferRead *m_pBufferRead;
362 FX_BOOL m_bReleaseStream; 362 FX_BOOL m_bReleaseStream;
363 FX_INT32» » » » m_iBufSize; 363 int32_t» » » » m_iBufSize;
364 }; 364 };
365 #endif 365 #endif
366 #ifdef FX_FILESIZE 366 #ifdef FX_FILESIZE
367 class CFGAS_FileWrite : public IFX_FileWrite 367 class CFGAS_FileWrite : public IFX_FileWrite
368 { 368 {
369 public: 369 public:
370 CFGAS_FileWrite(IFX_Stream *pStream, FX_BOOL bReleaseStream); 370 CFGAS_FileWrite(IFX_Stream *pStream, FX_BOOL bReleaseStream);
371 virtual ~CFGAS_FileWrite(); 371 virtual ~CFGAS_FileWrite();
372 virtual void Release() 372 virtual void Release()
373 { 373 {
(...skipping 22 matching lines...) Expand all
396 virtual FX_DWORD Flush(); 396 virtual FX_DWORD Flush();
397 virtual FX_BOOL WriteBlock(const void* pData, FX_DWORD s ize); 397 virtual FX_BOOL WriteBlock(const void* pData, FX_DWORD s ize);
398 virtual FX_BOOL WriteBlock(const void* pData, FX_DWORD o ffset, FX_DWORD size); 398 virtual FX_BOOL WriteBlock(const void* pData, FX_DWORD o ffset, FX_DWORD size);
399 399
400 protected: 400 protected:
401 IFX_Stream *m_pStream; 401 IFX_Stream *m_pStream;
402 FX_BOOL m_bReleaseStream; 402 FX_BOOL m_bReleaseStream;
403 }; 403 };
404 #endif 404 #endif
405 #endif 405 #endif
OLDNEW
« no previous file with comments | « xfa/src/fgas/src/crt/fx_memory.cpp ('k') | xfa/src/fgas/src/crt/fx_stream.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698