torc-master
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ParsePrimitive.hpp
Go to the documentation of this file.
1 // Torc - Copyright 2011-2013 University of Southern California. All Rights Reserved.
2 // $HeadURL$
3 // $Id$
4 
5 // This program is free software: you can redistribute it and/or modify it under the terms of the
6 // GNU General Public License as published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
10 // without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See
11 // the GNU General Public License for more details.
12 //
13 // You should have received a copy of the GNU General Public License along with this program. If
14 // not, see <http://www.gnu.org/licenses/>.
15 
16 /// \file
17 /// \brief Header for primitive parser.
18 
19 #ifndef TORC_PACKER_PARSEPRIMITIVE_HPP
20 #define TORC_PACKER_PARSEPRIMITIVE_HPP
21 
24 #include <stdio.h>
25 #include <stdlib.h>
26 #include <string.h>
27 
28 
29 namespace torc {
30  namespace physical {
31 
32 
33  /// \brief Pare Primitives.
34 
36  protected:
37 
38  // Input file
39  FILE *inFile;
40  // Input file name
41  const char *inFileName;
42  // current line
43  char *line;
44  //its allocated size
45  unsigned lineSize;
46  //Line number
47  unsigned lineNumber;
48 
49  /// \brief Reads the current line
50  void readCurrentLine();
51 
52  /// \brief Print printError.
53  void printError(const char *format, ...);
54 
55  public:
56  ParsePrimitive(){ lineSize = 2048; line = new char[2048];}
57 
58  /// \brief parse an XDLRC file
60  };
61 
62 } // namespace physical
63 } // namespace torc
64 
65 #endif // TORC_PACKER_PARSEPRIMITIVE_HPP
void readCurrentLine()
Reads the current line.
void printError(const char *format,...)
Print printError.
boost::shared_ptr< PrimitiveSet > PrimitiveSetSharedPtr
Shared pointer encapsulation of a PrimitiveSet.
PrimitiveSetSharedPtr ParsePrimitiveFile(const char *inFileName)
parse an XDLRC file
Header for the Factory class.
Header for the PrimitiveSet class.