Panda3D
interrogateElement.cxx
Go to the documentation of this file.
1 /**
2  * PANDA 3D SOFTWARE
3  * Copyright (c) Carnegie Mellon University. All rights reserved.
4  *
5  * All use of this software is subject to the terms of the revised BSD
6  * license. You should have received a copy of this license along
7  * with this source code in a file named "LICENSE."
8  *
9  * @file interrogateElement.cxx
10  * @author drose
11  * @date 2000-08-11
12  */
13 
14 #include "interrogateElement.h"
15 #include "interrogateDatabase.h"
16 #include "indexRemapper.h"
17 #include "interrogate_datafile.h"
18 
19 /**
20  * Formats the InterrogateElement data for output to a data file.
21  */
23 output(std::ostream &out) const {
25  out << _flags << " "
26  << _type << " "
27  << _getter << " "
28  << _setter << " "
29  << _has_function << " "
30  << _clear_function << " "
31  << _del_function << " "
32  << _length_function << " "
33  << _insert_function << " "
34  << _getkey_function << " ";
35  idf_output_string(out, _scoped_name);
36  idf_output_string(out, _comment, '\n');
37 }
38 
39 /**
40  * Reads the data file as previously formatted by output().
41  */
43 input(std::istream &in) {
45  in >> _flags >> _type >> _getter >> _setter;
47  in >> _has_function >> _clear_function;
49  in >> _del_function >> _length_function;
51  in >> _insert_function >> _getkey_function;
52  }
53  }
54  }
55  idf_input_string(in, _scoped_name);
56  idf_input_string(in, _comment);
57 }
58 
59 /**
60  * Remaps all internal index numbers according to the indicated map. This
61  * called from InterrogateDatabase::remap_indices().
62  */
65  _type = remap.map_from(_type);
66  _getter = remap.map_from(_getter);
67  _setter = remap.map_from(_setter);
68  _has_function = remap.map_from(_has_function);
69  _clear_function = remap.map_from(_clear_function);
70  _del_function = remap.map_from(_del_function);
71  _insert_function = remap.map_from(_insert_function);
72  _getkey_function = remap.map_from(_getkey_function);
73  _length_function = remap.map_from(_length_function);
74 }
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:29
void idf_output_string(ostream &out, const string &str, char whitespace)
Writes the indicated string to the output file.
void input(std::istream &in)
Reads the data file as previously formatted by output().
void idf_input_string(istream &in, string &str)
Reads the given string from the input file, as previously written by output_string().
void output(std::ostream &out) const
Formats the component for output to a data file.
void output(std::ostream &out) const
Formats the InterrogateElement data for output to a data file.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
void input(std::istream &in)
Reads the data file as previously formatted by output().
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
int map_from(int from) const
Returns the integer that the given 'from' integer had been set to map to, or the same integer if noth...