diff options
author | louis <louis.braun@gmx.de> | 2014-10-26 08:47:24 +0100 |
---|---|---|
committer | louis <louis.braun@gmx.de> | 2014-10-26 08:47:24 +0100 |
commit | e84c60f48aecc60d7289882d53b687920d223ef8 (patch) | |
tree | 0eab956c57c53831c67a3b4c8bfa428c19f24b52 /libcore | |
parent | 2129df34cb48d04b15a7aab0afbb5246a01cb0d4 (diff) | |
download | vdr-plugin-skindesigner-e84c60f48aecc60d7289882d53b687920d223ef8.tar.gz vdr-plugin-skindesigner-e84c60f48aecc60d7289882d53b687920d223ef8.tar.bz2 |
fixed bug that hasposter is only true if poster really exists
Diffstat (limited to 'libcore')
-rw-r--r-- | libcore/helpers.c | 5 | ||||
-rw-r--r-- | libcore/helpers.h | 1 |
2 files changed, 6 insertions, 0 deletions
diff --git a/libcore/helpers.c b/libcore/helpers.c index 1934f3e..4ca2272 100644 --- a/libcore/helpers.c +++ b/libcore/helpers.c @@ -90,6 +90,11 @@ bool isNumber(const string& s) { return !s.empty() && it == s.end(); } +bool FileExists(const string &fullpath) { + struct stat buffer; + return (stat (fullpath.c_str(), &buffer) == 0); +} + bool FileExists(const string &path, const string &name, const string &ext) { stringstream fileName; fileName << path << name << "." << ext; diff --git a/libcore/helpers.h b/libcore/helpers.h index f489555..2a92efb 100644 --- a/libcore/helpers.h +++ b/libcore/helpers.h @@ -12,6 +12,7 @@ int Minimum(int a, int b, int c, int d, int e, int f); std::string CutText(string &text, int width, string fontName, int fontSize); std::string StrToLowerCase(string str); bool isNumber(const string& s); +bool FileExists(const string &fullpath); bool FileExists(const string &path, const string &name, const string &ext); bool FolderExists(const string &path); bool FirstFileInFolder(string &path, string &extension, string &fileName); |