open_toontown_panda3d/dtool/src/interrogatedb/interrogateElement.cxx

52 lines
1.8 KiB
C++

// Filename: interrogateElement.C
// Created by: drose (11Aug00)
//
////////////////////////////////////////////////////////////////////
#include "interrogateElement.h"
#include "indexRemapper.h"
#include "interrogate_datafile.h"
////////////////////////////////////////////////////////////////////
// Function: InterrogateElement::output
// Access: Public
// Description: Formats the InterrogateElement data for output to a data
// file.
////////////////////////////////////////////////////////////////////
void InterrogateElement::
output(ostream &out) const {
InterrogateComponent::output(out);
out << _flags << " "
<< _type << " "
<< _getter << " "
<< _setter << " ";
idf_output_string(out, _scoped_name);
}
////////////////////////////////////////////////////////////////////
// Function: InterrogateElement::input
// Access: Public
// Description: Reads the data file as previously formatted by
// output().
////////////////////////////////////////////////////////////////////
void InterrogateElement::
input(istream &in) {
InterrogateComponent::input(in);
in >> _flags >> _type >> _getter >> _setter;
idf_input_string(in, _scoped_name);
}
////////////////////////////////////////////////////////////////////
// Function: InterrogateElement::remap_indices
// Access: Public
// Description: Remaps all internal index numbers according to the
// indicated map. This called from
// InterrogateDatabase::remap_indices().
////////////////////////////////////////////////////////////////////
void InterrogateElement::
remap_indices(const IndexRemapper &remap) {
_type = remap.map_from(_type);
_getter = remap.map_from(_getter);
_setter = remap.map_from(_setter);
}