Panda3D
 All Classes Functions Variables Enumerations
interrogateElement.cxx
1 // Filename: interrogateElement.cxx
2 // Created by: drose (11Aug00)
3 //
4 ////////////////////////////////////////////////////////////////////
5 //
6 // PANDA 3D SOFTWARE
7 // Copyright (c) Carnegie Mellon University. All rights reserved.
8 //
9 // All use of this software is subject to the terms of the revised BSD
10 // license. You should have received a copy of this license along
11 // with this source code in a file named "LICENSE."
12 //
13 ////////////////////////////////////////////////////////////////////
14 
15 #include "interrogateElement.h"
16 #include "interrogateDatabase.h"
17 #include "indexRemapper.h"
18 #include "interrogate_datafile.h"
19 
20 ////////////////////////////////////////////////////////////////////
21 // Function: InterrogateElement::output
22 // Access: Public
23 // Description: Formats the InterrogateElement data for output to a data
24 // file.
25 ////////////////////////////////////////////////////////////////////
27 output(ostream &out) const {
29  out << _flags << " "
30  << _type << " "
31  << _getter << " "
32  << _setter << " ";
33  idf_output_string(out, _scoped_name);
34  idf_output_string(out, _comment, '\n');
35 }
36 
37 ////////////////////////////////////////////////////////////////////
38 // Function: InterrogateElement::input
39 // Access: Public
40 // Description: Reads the data file as previously formatted by
41 // output().
42 ////////////////////////////////////////////////////////////////////
44 input(istream &in) {
46  in >> _flags >> _type >> _getter >> _setter;
47  idf_input_string(in, _scoped_name);
48 
50  idf_input_string(in, _comment);
51  }
52 }
53 
54 ////////////////////////////////////////////////////////////////////
55 // Function: InterrogateElement::remap_indices
56 // Access: Public
57 // Description: Remaps all internal index numbers according to the
58 // indicated map. This called from
59 // InterrogateDatabase::remap_indices().
60 ////////////////////////////////////////////////////////////////////
63  _type = remap.map_from(_type);
64  _getter = remap.map_from(_getter);
65  _setter = remap.map_from(_setter);
66 }
static int get_file_minor_version()
Returns the minor version number of the interrogate database file currently being read...
void remap_indices(const IndexRemapper &remap)
Remaps all internal index numbers according to the indicated map.
This class manages a mapping of integers to integers.
Definition: indexRemapper.h:33
void input(istream &in)
Reads the data file as previously formatted by output().
void input(istream &in)
Reads the data file as previously formatted by output().
int map_from(int from) const
Returns the integer that the given &#39;from&#39; integer had been set to map to, or the same integer if noth...
void output(ostream &out) const
Formats the InterrogateElement data for output to a data file.
void output(ostream &out) const
Formats the component for output to a data file.