Panda3D
 All Classes Functions Variables Enumerations
xFileParseData.h
00001 // Filename: xFileParseData.h
00002 // Created by:  drose (07Oct04)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) Carnegie Mellon University.  All rights reserved.
00008 //
00009 // All use of this software is subject to the terms of the revised BSD
00010 // license.  You should have received a copy of this license along
00011 // with this source code in a file named "LICENSE."
00012 //
00013 ////////////////////////////////////////////////////////////////////
00014 
00015 #ifndef XFILEPARSEDATA_H
00016 #define XFILEPARSEDATA_H
00017 
00018 #include "pandatoolbase.h"
00019 #include "xFileDataObject.h"
00020 #include "pointerTo.h"
00021 #include "pta_int.h"
00022 #include "pta_double.h"
00023 #include "pvector.h"
00024 
00025 ////////////////////////////////////////////////////////////////////
00026 //       Class : XFileParseData
00027 // Description : This class is used to fill up the data into an
00028 //               XFileDataNodeTemplate object as the data values are
00029 //               parsed out of the X file.  It only has a temporary
00030 //               lifespan; it will be converted into actual data by
00031 //               XFileDataNodeTemplate::finalize_parse_data().
00032 ////////////////////////////////////////////////////////////////////
00033 class XFileParseData {
00034 public:
00035   XFileParseData();
00036 
00037   void yyerror(const string &message) const;
00038 
00039   enum ParseFlags {
00040     PF_object     = 0x001,
00041     PF_reference  = 0x002,
00042     PF_double     = 0x004,
00043     PF_int        = 0x008,
00044     PF_string     = 0x010,
00045     PF_any_data   = 0x01f,
00046   };
00047 
00048   PT(XFileDataObject) _object;
00049   PTA_double _double_list;
00050   PTA_int _int_list;
00051   string _string;
00052   int _parse_flags;
00053 
00054   int _line_number;
00055   int _col_number;
00056   string _current_line;
00057 };
00058 
00059 ////////////////////////////////////////////////////////////////////
00060 //       Class : XFileParseDataList
00061 // Description : A container for a pvector of the above objects.  We
00062 //               need this wrapper class to avoid circular #includes;
00063 //               this allows XFileNode to define a forward reference
00064 //               to this class (without having to include this file or
00065 //               know that it contains a template class).
00066 ////////////////////////////////////////////////////////////////////
00067 class XFileParseDataList {
00068 public:
00069   typedef pvector<XFileParseData> List;
00070   List _list;
00071 };
00072 
00073 #include "xFileParseData.I"
00074 
00075 #endif
00076 
 All Classes Functions Variables Enumerations