List of all members.
Detailed Description
Definition at line 24 of file fcache.
Constructor & Destructor Documentation
inlib::file::base_cache::base_cache |
( |
std::ostream & |
a_out, |
|
|
bool |
a_verbose |
|
) |
| [inline] |
virtual inlib::file::base_cache::~base_cache |
( |
| ) |
[inline, virtual] |
inlib::file::base_cache::base_cache |
( |
const base_cache & |
a_from | ) |
[inline, protected] |
Member Function Documentation
void inlib::file::base_cache::clear |
( |
| ) |
[inline] |
Definition at line 96 of file fcache.
{
std::map<std::string,std::string>::iterator it;
for(it = m_cache.begin();it!=m_cache.end();++it) {
::remove((*it).second.c_str());
}
m_cache.clear();
}
virtual bool inlib::file::base_cache::fetch |
( |
const std::string & |
a_what, |
|
|
std::string & |
a_file |
|
) |
| [inline, virtual] |
Implements inlib::file::cache.
Definition at line 26 of file fcache.
{
std::map<std::string,std::string>::iterator it = m_cache.find(a_what);
if(it!=m_cache.end()) {
if(exists((*it).second)) {
a_file = (*it).second;
return true;
}
m_out << "inlib::file::base_cache::fetch :"
<< " WARNING : for " << sout(a_what)
<< ", file in the map no more here. We fetch again the file."
<< std::endl;
m_cache.erase(it);
}
std::string file;
if(!inlib::tmpname(m_tmp_dir,"inlib_base_cache_",m_tmp_suffix,file)) {
m_out << "inlib::file::base_cache::fetch :"
<< " can't get a tmpname."
<< std::endl;
a_file.clear();
return false;
}
if(!fetch_file(a_what,file)) {
m_out << "inlib::file::base_cache::fetch :"
<< " failed to fetch " << sout(a_what)
<< std::endl;
::remove(file.c_str());
a_file.clear();
return false;
}
m_cache[a_what] = file;
a_file = file;
return true;
}
virtual bool inlib::file::base_cache::fetch_file |
( |
const std::string & |
a_what, |
|
|
const std::string & |
a_file |
|
) |
| [protected, pure virtual] |
void inlib::file::base_cache::set_tmp_dir |
( |
const std::string & |
a_dir | ) |
[inline] |
void inlib::file::base_cache::set_tmp_suffix |
( |
const std::string & |
a_suffix | ) |
[inline] |
Definition at line 93 of file fcache.
{
m_tmp_suffix = a_suffix;
}
Member Data Documentation
The documentation for this class was generated from the following file:
- /Users/barrand/private/dev/softinex/old/inexlib-1.2/inlib/inlib/fcache