Panda3D

xFileParseData.h
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 xFileParseData.h
10 * @author drose
11 * @date 2004-10-07
12 */
13
14 #ifndef XFILEPARSEDATA_H
15 #define XFILEPARSEDATA_H
16
17 #include "pandatoolbase.h"
18 #include "xFileDataObject.h"
19 #include "pointerTo.h"
20 #include "pta_int.h"
21 #include "pta_double.h"
22 #include "pvector.h"
23
24 /**
25 * This class is used to fill up the data into an XFileDataNodeTemplate object
26 * as the data values are parsed out of the X file. It only has a temporary
27 * lifespan; it will be converted into actual data by
28 * XFileDataNodeTemplate::finalize_parse_data().
29 */
30 class XFileParseData {
31 public:
32 XFileParseData();
33
34 void yyerror(const std::string &message) const;
35
36 enum ParseFlags {
37 PF_object = 0x001,
38 PF_reference = 0x002,
39 PF_double = 0x004,
40 PF_int = 0x008,
41 PF_string = 0x010,
42 PF_any_data = 0x01f,
43 };
44
45 PT(XFileDataObject) _object;
46 PTA_double _double_list;
47 PTA_int _int_list;
48 std::string _string;
49 int _parse_flags;
50
51 int _line_number;
52 int _col_number;
53 std::string _current_line;
54 };
55
56 /**
57 * A container for a pvector of the above objects. We need this wrapper class
58 * to avoid circular #includes; this allows XFileNode to define a forward
59 * reference to this class (without having to include this file or know that
60 * it contains a template class).
61 */
62 class XFileParseDataList {
63 public:
64 typedef pvector<XFileParseData> List;
65 List _list;
66 };
67
68 #include "xFileParseData.I"
69
70 #endif
XFileDataObject
The abstract base class for a number of different types of data elements that may be stored in the X ...
Definition: xFileDataObject.h:30
XFileParseDataList
A container for a pvector of the above objects.
Definition: xFileParseData.h:62
XFileParseData
This class is used to fill up the data into an XFileDataNodeTemplate object as the data values are pa...
Definition: xFileParseData.h:30
XFileParseData::yyerror
void yyerror(const std::string &message) const
Reports a parsing error message to the user, showing the line and column from which this object was o...
Definition: xFileParseData.cxx:37
pvector< XFileParseData >
pandatoolbase.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pointerTo.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pta_double.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pta_int.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
pvector.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
xFileDataObject.h
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
xFileParseData.I
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.