39 #if !defined(TAWARA_ELEMENT_H_)
40 #define TAWARA_ELEMENT_H_
104 uint32_t
id()
const {
return id_; }
117 std::streampos
offset()
const {
return offset_; }
126 virtual std::streamsize
size()
const;
137 virtual std::streamsize
write(std::ostream& output);
163 virtual std::streamsize
read(std::istream& input);
179 virtual std::streamsize body_size()
const = 0;
190 std::streamsize write_id(std::ostream& output);
200 virtual std::streamsize write_size(std::ostream& output);
210 virtual std::streamsize write_body(std::ostream& output) = 0;
238 virtual std::streamsize read_body(std::istream& input,
239 std::streamsize
size) = 0;
256 std::streamsize
skip_read(std::istream& input,
bool and_id);
271 std::streamsize
skip_write(std::iostream& stream,
bool and_id);
277 #endif // TAWARA_ELEMENT_H_
std::streamsize write(ID id, std::ostream &output)
Write an ID to an output stream.
std::streamsize skip_write(std::iostream &stream, bool and_id)
Skip an element in an input/output stream.
virtual ~Element()
Destructor.
std::streamsize size(ID id)
Get the number of bytes required by an ID.
std::streampos offset() const
Get the element's offset in the byte stream.
uint32_t id() const
Get the element's ID.
ReadResult read(std::istream &input)
Read an ID from an input stream.
std::streamsize skip_read(std::istream &input, bool and_id)
Skip an element in an input stream.
The Element interface, a basic interface to an element object.