UNIVERS  15.3
UNIVERS base processing software API
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
TapeReader.hpp
1 /* TapeReader.hpp */
2 /* $Id: TapeReader.hpp,v 1.2 2008/11/27 13:07:51 vlad Exp $ */
3 #ifndef __TapeReader_hpp
4 #define __TapeReader_hpp
5 
6 
8 #define TapeReaderBlockSize 65536
9 
10 
17 {
18 public:
19 
20  enum ReadStatus {
27  };
28 
29 
39  TapeReader (const char* szPath, int nSize = TapeReaderBlockSize);
40 
42  virtual ~TapeReader ();
43 
47  int read (ReadStatus& status, void* buffer, int req_size = 0);
48 
51  void undo_read (void* buffer, int undo_size);
52 
53 
57  void set_block_mode (bool bFlag);
58 
62  bool get_block_mode () const;
63 
64 
66  int get_max_block_size () const;
67 
68 
71  void set_max_errors (int nErrors);
72 
74  int get_max_errors () const;
75 
76 
79  bool is_tape () const;
80 
81 protected:
82 
87  static int open (const char* szPath, bool& bTape);
88 
92  int read (void* buf, int req_size);
93 
95  int fdTape;
96 
98  bool bBlockMode;
99 
102 
105 
108 
111 
114 
117 
120 
121 };
122 
123 
124 #endif /* TapeReader.hpp */
void set_max_errors(int nErrors)
bool bBlockMode
Definition: TapeReader.hpp:98
int read(ReadStatus &status, void *buffer, int req_size=0)
int fdTape
Definition: TapeReader.hpp:95
Definition: TapeReader.hpp:22
Definition: TapeReader.hpp:25
int get_max_block_size() const
int get_max_errors() const
void set_block_mode(bool bFlag)
bool get_block_mode() const
Definition: TapeReader.hpp:21
int nDataOffset
Definition: TapeReader.hpp:116
int nMaxBlockSize
Definition: TapeReader.hpp:107
ReadStatus ePrevStatus
Definition: TapeReader.hpp:104
Definition: TapeReader.hpp:26
char * pBlockBuffer
Definition: TapeReader.hpp:113
Definition: TapeReader.hpp:24
TapeReader(const char *szPath, int nSize=TapeReaderBlockSize)
int nMaxErrors
Definition: TapeReader.hpp:110
ReadStatus
Definition: TapeReader.hpp:20
void undo_read(void *buffer, int undo_size)
virtual ~TapeReader()
bool is_tape() const
static int open(const char *szPath, bool &bTape)
Definition: TapeReader.hpp:16
bool bTapeDevice
Definition: TapeReader.hpp:101
int nDataSize
Definition: TapeReader.hpp:119