|
00001 //--------------------------------------------------------------------------------------- 00002 // Copyright (c) 2001-2012 by PDFTron Systems Inc. All Rights Reserved. 00003 // Consult legal.txt regarding legal and license information. 00004 //--------------------------------------------------------------------------------------- 00005 00006 #ifndef H_CPPFilterFilter 00007 #define H_CPPFilterFilter 00008 00009 #include <Common/UString.h> 00010 #include <C/Filters/TRN_Filter.h> 00011 #include <C/Common/TRN_Types.h> 00012 #include <stdio.h> 00013 00014 namespace pdftron { 00015 namespace Filters { 00016 00046 class Filter 00047 { 00048 public: 00049 Filter(); 00050 ~Filter (); 00051 00052 Filter(const Filter& copy); 00053 00054 Filter& operator=(const Filter& other); 00055 00059 operator bool () { return m_impl!=0;} 00060 00066 void AttachFilter(Filter attach_filter); 00067 00074 Filter ReleaseAttachedFilter (); 00075 00079 Filter GetAttachedFilter (); 00080 00084 Filter GetSourceFilter (); 00085 00089 const char* GetName () const; 00090 00096 const char* GetDecodeName () const; 00097 00098 #ifndef SWIG 00099 00103 UChar* Begin (); 00104 #endif 00105 00110 size_t Size (); 00111 00118 void Consume (size_t num_bytes); 00119 00124 size_t Count (); 00125 00134 size_t SetCount (size_t new_count); 00135 00144 void SetStreamLength (size_t bytes); 00145 00150 void Flush (); 00151 00155 void FlushAll (); 00156 00160 bool IsInputFilter (); 00161 00166 bool CanSeek (); 00167 00171 enum ReferencePos 00172 { 00173 e_begin = SEEK_SET, 00174 e_end = SEEK_END, 00175 e_cur = SEEK_CUR 00176 }; 00177 00195 void Seek (ptrdiff_t offset, ReferencePos origin); 00196 00203 ptrdiff_t Tell (); 00204 00214 Filter CreateInputIterator (); 00215 00220 const UString GetFilePath() const; 00221 00225 void Destroy(); 00226 00228 #ifndef SWIGHIDDEN 00229 TRN_Filter m_impl; 00230 Filter(TRN_Filter impl, bool is_owner); 00231 bool m_owner; 00232 #endif 00234 }; 00235 00236 00237 #include <Impl/Filter.inl> 00238 00239 00240 }; // namespace Filters 00241 }; // namespace pdftron 00242 00243 #endif