std::vector<std::string> TextFile::read() { if(!isValid_() || !isReading()) { throw IOError("File is not open for reading"); } for(const auto& symbol : skipSymbols_) { if(boost::starts_with(next_line_, symbol)) { advanceLine_(); return read(); } } std::vector<std::string> sline; boost::split(sline, next_line_, boost::is_any_of(delimiter_)); for(auto& s : sline) { boost::trim(s); } // Prefetch the next line from the file. advanceLine_(); return sline; }
void TextFile::advanceLine_() { do { std::getline(*in_strm_, next_line_); trim(next_line_); } while(isValid_() && next_line_ == ""); }
void TextureObject::unload_( ) { LBASSERT( isValid_() ); if( !textureState_->texturePoolPtr ) return; textureState_->texturePoolPtr->releaseTexture( textureState_ ); #ifdef _DEBUG_ LBVERB << "Texture released : " << lodNodePtr_->getNodeId() << " Last used at : " << getLastUsed() << " Number of references : " << getReferenceCount_( ) << std::endl; #endif //_DEBUG }