35 using std::istringstream ;
64 string key =
"BES.Uncompress.Retry" ;
67 if( !found || val.empty() )
73 istringstream is( val ) ;
77 key =
"BES.Uncompress.NumTries" ;
80 if( !found || val.empty() )
86 istringstream is( val ) ;
104 BESUncompressManager::UCIter i ;
105 i = _uncompress_list.find( name ) ;
106 if( i == _uncompress_list.end() )
108 _uncompress_list[name] = method ;
125 BESUncompressManager::UIter i ;
126 i = _uncompress_list.find( name ) ;
127 if( i != _uncompress_list.end() )
129 _uncompress_list.erase( i ) ;
146 BESUncompressManager::UCIter i ;
147 i = _uncompress_list.find( name ) ;
148 if( i != _uncompress_list.end() )
164 bool first_name = true ;
165 BESUncompressManager::UCIter i = _uncompress_list.begin() ;
166 for( ; i != _uncompress_list.end(); i++ )
216 BESDEBUG(
"bes",
"BESUncompressManager::uncompress - src = " << src << endl ) ;
217 string::size_type dot = src.rfind(
"." ) ;
218 if( dot != string::npos )
220 string ext = src.substr( dot+1, src.length() - dot ) ;
225 for(
int i = 0; i < static_cast<int>(ext.length()); i++ )
227 ext[i] = tolower( ext[i] ) ;
242 if( cache.
lock( _retry, _num_tries ) )
249 BESDEBUG(
"bes",
"BESUncompressManager::uncompress - is cached? " << src << endl ) ;
252 BESDEBUG(
"bes",
"BESUncompressManager::uncompress - " <<
"is cached " << target << endl ) ;
260 BESDEBUG(
"bes",
"BESUncompressManager::uncompress - " <<
"purging cache" << endl ) ;
264 BESDEBUG(
"bes",
"BESUncompressManager::uncompress - "
265 <<
"uncompress to " << target
266 <<
" using " << ext <<
" uncompression"
295 string err = (string)
"Problem working with the cache, "
298 throw BESInternalError(
"Problem working with the cache, unknown error", __FILE__,__LINE__);
303 string err =
"Unable to lock the cache "
310 BESDEBUG(
"bes",
"BESUncompressManager::uncompress - not compressed " << endl ) ;
315 BESDEBUG(
"bes",
"BESUncompressmanager::uncompress - not file extension" << endl ) ;
319 string err =
"Unable to determine type of file from "
339 << (
void *)
this <<
")" << endl ;
341 if( _uncompress_list.size() )
345 BESUncompressManager::UCIter i = _uncompress_list.begin() ;
346 BESUncompressManager::UCIter ie = _uncompress_list.end() ;
347 for( ; i != ie; i++ )