| 2157 | |
| 2158 | |
| 2159 | XMLError XMLDocument::LoadFile( const char* filename ) |
| 2160 | { |
| 2161 | if ( !filename ) { |
| 2162 | TIXMLASSERT( false ); |
| 2163 | SetError( XML_ERROR_FILE_COULD_NOT_BE_OPENED, 0, "filename=<null>" ); |
| 2164 | return _errorID; |
| 2165 | } |
| 2166 | |
| 2167 | Clear(); |
| 2168 | FILE* fp = callfopen( filename, "rb" ); |
| 2169 | if ( !fp ) { |
| 2170 | SetError( XML_ERROR_FILE_NOT_FOUND, 0, "filename=%s", filename ); |
| 2171 | return _errorID; |
| 2172 | } |
| 2173 | LoadFile( fp ); |
| 2174 | fclose( fp ); |
| 2175 | return _errorID; |
| 2176 | } |
| 2177 | |
| 2178 | // This is likely overengineered template art to have a check that unsigned long value incremented |
| 2179 | // by one still fits into size_t. If size_t type is larger than unsigned long type |
nothing calls this directly
no test coverage detected