aboutsummaryrefslogtreecommitdiff
path: root/src/client/filecache.cpp
diff options
context:
space:
mode:
authorElias Fleckenstein <eliasfleckenstein@web.de>2020-11-04 16:57:41 +0100
committerElias Fleckenstein <eliasfleckenstein@web.de>2020-11-04 16:57:41 +0100
commit6ccb5835ff55d85156be91473c598eca9d6cb9a6 (patch)
tree7f1eaf8b94694c8e24e206909ba8f55a1ebfbb3e /src/client/filecache.cpp
parent244713971a976e43e8740b6a9d9d122e37020ef2 (diff)
downloaddragonfireclient-6ccb5835ff55d85156be91473c598eca9d6cb9a6.tar.xz
Revert "Make Lint Happy"
This reverts commit ad148587dcf5244c2d2011dba339786c765c54c4.
Diffstat (limited to 'src/client/filecache.cpp')
-rw-r--r--src/client/filecache.cpp27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/client/filecache.cpp b/src/client/filecache.cpp
index 0c8f06198..46bbe4059 100644
--- a/src/client/filecache.cpp
+++ b/src/client/filecache.cpp
@@ -32,28 +32,28 @@ bool FileCache::loadByPath(const std::string &path, std::ostream &os)
{
std::ifstream fis(path.c_str(), std::ios_base::binary);
- if (!fis.good()) {
- verbosestream << "FileCache: File not found in cache: " << path
- << std::endl;
+ if(!fis.good()){
+ verbosestream<<"FileCache: File not found in cache: "
+ <<path<<std::endl;
return false;
}
bool bad = false;
- for (;;) {
+ for(;;){
char buf[1024];
fis.read(buf, 1024);
std::streamsize len = fis.gcount();
os.write(buf, len);
- if (fis.eof())
+ if(fis.eof())
break;
- if (!fis.good()) {
+ if(!fis.good()){
bad = true;
break;
}
}
- if (bad) {
- errorstream << "FileCache: Failed to read file from cache: \"" << path
- << "\"" << std::endl;
+ if(bad){
+ errorstream<<"FileCache: Failed to read file from cache: \""
+ <<path<<"\""<<std::endl;
}
return !bad;
@@ -61,10 +61,13 @@ bool FileCache::loadByPath(const std::string &path, std::ostream &os)
bool FileCache::updateByPath(const std::string &path, const std::string &data)
{
- std::ofstream file(path.c_str(), std::ios_base::binary | std::ios_base::trunc);
+ std::ofstream file(path.c_str(), std::ios_base::binary |
+ std::ios_base::trunc);
- if (!file.good()) {
- errorstream << "FileCache: Can't write to file at " << path << std::endl;
+ if(!file.good())
+ {
+ errorstream<<"FileCache: Can't write to file at "
+ <<path<<std::endl;
return false;
}