48output(std::ostream &out)
const {
50 if (!_bead_id.empty()) {
51 out <<
" (" << _bead_id <<
")";
60 return _converted_filename;
68 _converted_filename = filename;
77bool FltExternalReference::
79 if (!FltBead::extract_record(reader)) {
83 nassertr(reader.
get_opcode() == FO_external_ref,
false);
93 _orig_filename = name;
95 if (!name.empty() && name[name.length() - 1] ==
'>') {
97 size_t open = name.rfind(
'<');
98 if (open != std::string::npos) {
99 _orig_filename = name.substr(0, open);
100 _bead_id = name.substr(open + 1, name.length() - open - 2);
103 _converted_filename = _header->convert_path(Filename::from_os_specific(_orig_filename));
114bool FltExternalReference::
116 if (!FltBead::build_record(writer)) {
123 std::string name = _orig_filename;
124 if (!_bead_id.empty()) {
125 name +=
"<" + _bead_id +
">";
A class to retrieve the individual data elements previously stored in a Datagram.
void skip_bytes(size_t size)
Skips over the indicated number of bytes in the datagram.
uint32_t get_be_uint32()
Extracts an unsigned 32-bit big-endian integer.
std::string get_fixed_string(size_t size)
Extracts a fixed-length string.
An ordered list of data elements, formatted in memory for transmission over a socket or writing to a ...
void add_be_uint32(uint32_t value)
Adds an unsigned 32-bit big-endian integer to the datagram.
void add_fixed_string(const std::string &str, size_t size)
Adds a fixed-length string to the datagram.
void pad_bytes(size_t size)
Adds the indicated number of zero bytes to the datagram.
The name of a file, such as a texture file or an Egg file.
std::string to_os_generic() const
This is similar to to_os_specific(), but it is designed to generate a filename that can be understood...
A base class for any of a broad family of flt records that represent particular beads in the hierarch...
virtual void output(std::ostream &out) const
Writes a quick one-line description of the record, but not its children.
virtual void apply_converted_filenames()
Walks the hierarchy at this record and below and copies the _converted_filename record into the _orig...
Filename get_ref_filename() const
Returns the name of the referenced file.
void set_ref_filename(const Filename &filename)
Changes the name of the referenced file.
This class turns an istream into a sequence of FltRecords by reading a sequence of Datagrams and extr...
FltOpcode get_opcode() const
Returns the opcode associated with the current record.
DatagramIterator & get_iterator()
Returns an iterator suitable for extracting data from the current record.
This class writes a sequence of FltRecords to an ostream, handling opcode and size counts properly.
void set_opcode(FltOpcode opcode)
Sets the opcode associated with the current record.
Datagram & update_datagram()
Returns a modifiable reference to the datagram associated with the current record.
void check_remaining_size(const DatagramIterator &di, const std::string &name=std::string()) const
Checks that the iterator has no bytes left, as it should at the end of a successfully read record.
virtual void apply_converted_filenames()
Walks the hierarchy at this record and below and copies the _converted_filename record into the _orig...
TypeHandle is the identifier used to differentiate C++ class types.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.