Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

objloader.inl

Go to the documentation of this file.
00001 /*
00002     Sheep - A Rigid Body Dynamics Engine
00003     Copyright (C) 2001-2004 Francois Beaune
00004     Contact: http://toxicengine.sourceforge.net/
00005 
00006     This file is part of Sheep.
00007 
00008     Sheep is free software; you can redistribute it and/or modify
00009     it under the terms of the GNU General Public License as published by
00010     the Free Software Foundation; either version 2 of the License, or
00011     (at your option) any later version.
00012 
00013     Sheep is distributed in the hope that it will be useful,
00014     but WITHOUT ANY WARRANTY; without even the implied warranty of
00015     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016     GNU General Public License for more details.
00017 
00018     You should have received a copy of the GNU General Public License
00019     along with Sheep; if not, write to the Free Software
00020     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00021 */
00022 
00023 inline
00024 int OBJLoader::look_ahead() {
00025     assert(m_file);
00026 
00027     const int c = fgetc(m_file);
00028 
00029     if(c != EOF)
00030         ungetc(c, m_file);
00031 
00032     return c;
00033 }
00034 
00035 inline
00036 void OBJLoader::accept_char(int ref) {
00037     assert(m_file);
00038 
00039     const int c = fgetc(m_file);
00040 
00041     if(c != ref)
00042         parse_error();
00043 
00044     if(c == '\n')
00045         ++m_line;
00046 }
00047 
00048 inline
00049 void OBJLoader::accept_newline() {
00050     assert(m_file);
00051 
00052     const int c = fgetc(m_file);
00053 
00054     if(c == '\n')
00055         ++m_line;
00056     else if(c != EOF)
00057         parse_error();
00058 }
00059 
00060 inline
00061 bool OBJLoader::is_eol() {
00062     assert(m_file);
00063 
00064     const int c = fgetc(m_file);
00065 
00066     if(c == EOF)
00067         return true;
00068 
00069     ungetc(c, m_file);
00070 
00071     return c == '\n';
00072 }

Generated on Tue May 11 01:31:51 2004 for toxic by doxygen 1.3.6