15 #include "fltBeadID.h"
16 #include "fltRecordReader.h"
17 #include "fltRecordWriter.h"
78 if (!FltBead::extract_record(reader)) {
99 size_t zero_byte = s.find(
'\0');
100 _id = s.substr(0, zero_byte);
104 return FltBead::extract_ancillary(reader);
117 if (!FltBead::build_record(writer)) {
134 if (_id.length() > 7) {
139 while ((
id.length() % 4) != 0) {
145 if (result != FE_ok) {
150 return FltBead::write_ancillary(writer);
virtual void output(ostream &out) const
Writes a quick one-line description of the record, but not its children.
const string & get_id() const
Returns the id (name) of this particular bead.
This class writes a sequence of FltRecords to an ostream, handling opcode and size counts properly...
This class turns an istream into a sequence of FltRecords by reading a sequence of Datagrams and extr...
A base class for any of a broad family of flt records that represent particular beads in the hierarch...
DatagramIterator & get_iterator()
Returns an iterator suitable for extracting data from the current record.
void set_id(const string &id)
Changes the id (name) of this particular bead.
string get_remaining_bytes() const
Returns the remaining bytes in the datagram as a string, but does not extract them from the iterator...
FltOpcode get_opcode() const
Returns the opcode associated with the current record.
void add_fixed_string(const string &str, size_t size)
Adds a fixed-length string to the datagram.
TypeHandle is the identifier used to differentiate C++ class types.
Datagram & update_datagram()
Returns a modifiable reference to the datagram associated with the current record.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
FltError write_record(FltOpcode opcode, const Datagram &datagram=Datagram())
A convenience function to quickly write a simple record that consists of an opcode and possibly a dat...
string get_fixed_string(size_t size)
Extracts a fixed-length string.