Public Member Functions | |
virtual bool | check (const std::string &proto, const std::string &path, IOOffset *size=0) |
virtual Storage * | open (const std::string &proto, const std::string &path, int mode, const std::string &tmpdir) |
Definition at line 8 of file LocalStorageMaker.cc.
virtual bool LocalStorageMaker::check | ( | const std::string & | proto, | |
const std::string & | path, | |||
IOOffset * | size = 0 | |||
) | [inline, virtual] |
Reimplemented from StorageMaker.
Definition at line 29 of file LocalStorageMaker.cc.
References size.
00032 { 00033 struct stat st; 00034 if (stat (path.c_str(), &st) != 0) 00035 return false; 00036 00037 if (size) 00038 *size = st.st_size; 00039 00040 return true; 00041 }
virtual Storage* LocalStorageMaker::open | ( | const std::string & | proto, | |
const std::string & | path, | |||
int | mode, | |||
const std::string & | tmpdir | |||
) | [inline, virtual] |
Implements StorageMaker.
Definition at line 11 of file LocalStorageMaker.cc.
References StorageFactory::CACHE_HINT_STORAGE, StorageFactory::cacheHint(), f, StorageFactory::get(), IOFlags::OpenUnbuffered, StorageFactory::READ_HINT_UNBUFFERED, and StorageFactory::readHint().
00015 { 00016 StorageFactory *f = StorageFactory::get(); 00017 StorageFactory::ReadHint readHint = f->readHint(); 00018 StorageFactory::CacheHint cacheHint = f->cacheHint(); 00019 00020 if (readHint != StorageFactory::READ_HINT_UNBUFFERED 00021 || cacheHint == StorageFactory::CACHE_HINT_STORAGE) 00022 mode &= ~IOFlags::OpenUnbuffered; 00023 else 00024 mode |= IOFlags::OpenUnbuffered; 00025 00026 return new File (path, mode); 00027 }