00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
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 }