Scopira  20080306
binflow.h
1 
2 /*
3  * Copyright (c) 2002-2007 National Research Council
4  *
5  * All rights reserved.
6  *
7  * This material is confidential and proprietary information of
8  * National Research Council Canada ("Confidential Information").
9  * This Confidential Information may only be used and reproduced
10  * in accordance with the terms of the license agreement.
11  *
12  */
13 
14 #ifndef __INCLUDED_SCOPIRA_TOOL_BINFLOW_H__
15 #define __INCLUDED_SCOPIRA_TOOL_BINFLOW_H__
16 
17 #include <scopira/tool/flow.h>
18 #include <scopira/tool/export.h>
19 
20 namespace scopira
21 {
22  namespace tool
23  {
24  class biniflow;
25  class binoflow;
26 
27  class bin64iflow;
28  class bin64oflow;
29  }
30 }
31 
38 {
39  protected:
42 
43  public:
51  SCOPIRA_EXPORT biniflow(bool doref, iflow_i* in);
53  SCOPIRA_EXPORT virtual ~biniflow(void);
54 
56  SCOPIRA_EXPORT virtual bool failed(void) const;
57 
59  SCOPIRA_EXPORT virtual size_t read(byte_t* _buf, size_t _maxsize);
60 
61  SCOPIRA_EXPORT virtual bool read_bool(bool&);
62  SCOPIRA_EXPORT virtual bool read_char(char&);
63  SCOPIRA_EXPORT virtual bool read_short(short&);
64  SCOPIRA_EXPORT virtual bool read_int(int&);
65  SCOPIRA_EXPORT virtual bool read_size_t(size_t&);
66  SCOPIRA_EXPORT virtual bool read_int64_t(int64_t&);
67  SCOPIRA_EXPORT virtual bool read_long(long&);
68  SCOPIRA_EXPORT virtual bool read_float(float&);
69  SCOPIRA_EXPORT virtual bool read_double(double&);
70  SCOPIRA_EXPORT virtual bool read_string(std::string&);
71 
73  SCOPIRA_EXPORT void open(iflow_i* in);
75  SCOPIRA_EXPORT void close(void);
76 };
77 
85 {
86  protected:
89 
90  public:
98  SCOPIRA_EXPORT binoflow(bool doref, oflow_i* in);
100  SCOPIRA_EXPORT virtual ~binoflow(void);
101 
103  SCOPIRA_EXPORT virtual bool failed(void) const;
104 
106  SCOPIRA_EXPORT virtual size_t write(const byte_t* _buf, size_t _size);
107 
108  SCOPIRA_EXPORT virtual void write_bool(bool val);
109  SCOPIRA_EXPORT virtual void write_char(char val);
110  SCOPIRA_EXPORT virtual void write_short(short val);
111  SCOPIRA_EXPORT virtual void write_int(int val);
112  SCOPIRA_EXPORT virtual void write_size_t(size_t val);
113  SCOPIRA_EXPORT virtual void write_int64_t(int64_t val);
114  SCOPIRA_EXPORT virtual void write_long(long val);
115  SCOPIRA_EXPORT virtual void write_float(float val);
116  SCOPIRA_EXPORT virtual void write_double(double val);
117  SCOPIRA_EXPORT virtual void write_string(const std::string& val);
118 
120  SCOPIRA_EXPORT void open(oflow_i* in);
122  SCOPIRA_EXPORT void close(void);
123 };
124 
132 {
133  public:
141  SCOPIRA_EXPORT bin64iflow(bool doref, iflow_i* in);
142 
143  SCOPIRA_EXPORT virtual bool read_size_t(size_t&);
144  SCOPIRA_EXPORT virtual bool read_long(long&);
145 };
146 
147 
155 {
156  public:
164  SCOPIRA_EXPORT bin64oflow(bool doref, oflow_i* in);
165 
166  SCOPIRA_EXPORT virtual void write_size_t(size_t val);
167  SCOPIRA_EXPORT virtual void write_long(long val);
168 };
169 
170 #endif
171 
Definition: binflow.h:154
virtual bool read_string(std::string &)
virtual ~biniflow(void)
destructor
Definition: flow.h:108
scopira::tool::byte_t byte_t
Definition: flow.h:73
Definition: binflow.h:131
Definition: archiveflow.h:20
Definition: flow.h:212
Definition: flow.h:281
Definition: object.h:43
Definition: binflow.h:37
virtual bool read_int64_t(int64_t &)
biniflow(bool doref, iflow_i *in)
virtual bool read_char(char &)
virtual bool read_size_t(size_t &)
virtual bool read_bool(bool &)
count2_ptr< oflow_i > dm_out
output link
Definition: binflow.h:88
virtual bool read_long(long &)
virtual size_t read(byte_t *_buf, size_t _maxsize)
read raw block data, returns num read in
virtual bool read_float(float &)
void open(iflow_i *in)
opens a new link
Definition: binflow.h:84
virtual bool read_int(int &)
virtual bool read_short(short &)
virtual bool failed(void) const
are we in a failed state?
virtual bool read_double(double &)
void close(void)
close the current link
count2_ptr< iflow_i > dm_in
input flow
Definition: binflow.h:41
Definition: flow.h:159