All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Filter.h
Go to the documentation of this file.
1 //---------------------------------------------------------------------------------------
2 // Copyright (c) 2001-2020 by PDFTron Systems Inc. All Rights Reserved.
3 // Consult legal.txt regarding legal and license information.
4 //---------------------------------------------------------------------------------------
5 #ifndef PDFTRON_H_CPPFiltersFilter
6 #define PDFTRON_H_CPPFiltersFilter
7 
8 #include <Common/UString.h>
9 #include <C/Filters/TRN_Filter.h>
10 #include <C/Common/TRN_Types.h>
11 #include <stdio.h>
12 
13 namespace pdftron {
14  namespace Filters {
15 
45 class Filter
46 {
47 public:
48  Filter();
49  ~Filter ();
50 
51  Filter(const Filter& copy);
52 
53  Filter& operator=(const Filter& other);
54 
58  operator bool () { return m_impl!=0;}
59 
66  void AttachFilter(Filter attach_filter);
67 
75 
80 
85 
89  const char* GetName () const;
90 
96  const char* GetDecodeName () const;
97 
98 #ifndef SWIG
99 
103  UChar* Begin ();
104 #endif
105 
110  size_t Size ();
111 
118  void Consume (size_t num_bytes);
119 
124  size_t Count ();
125 
135  size_t SetCount (size_t new_count);
136 
145  void SetStreamLength (size_t bytes);
146 
151  void Flush ();
152 
156  void FlushAll ();
157 
161  bool IsInputFilter ();
162 
167  bool CanSeek ();
168 
173  {
174  e_begin = SEEK_SET,
175  e_end = SEEK_END,
176  e_cur = SEEK_CUR
177  };
178 
196  void Seek (ptrdiff_t offset, ReferencePos origin);
197 
204  ptrdiff_t Tell ();
205 
216 
221  const UString GetFilePath() const;
222 
226  void Destroy();
227 
235  void WriteToFile(const UString& path, bool append);
236 // @cond PRIVATE_DOC
237 #ifndef SWIGHIDDEN
238  TRN_Filter m_impl;
239  Filter(TRN_Filter impl, bool is_owner);
240  bool m_owner;
241 #endif
242 // @endcond
243 };
244 
245 
246 #include <Impl/Filter.inl>
247 
248 
249  }; // namespace Filters
250 }; // namespace pdftron
251 
252 #endif // PDFTRON_H_CPPFiltersFilter
void WriteToFile(const UString &path, bool append)
void Seek(ptrdiff_t offset, ReferencePos origin)
void Consume(size_t num_bytes)
void SetStreamLength(size_t bytes)
const char * GetName() const
Filter & operator=(const Filter &other)
TRN_UChar UChar
Definition: BasicTypes.h:12
const UString GetFilePath() const
const char * GetDecodeName() const
size_t SetCount(size_t new_count)
void AttachFilter(Filter attach_filter)