diff options
author | Andrei Karas <akaras@inbox.ru> | 2011-06-16 01:39:44 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2011-06-16 02:24:22 +0300 |
commit | 654285675ececa142877d86e6f730d040625fc6e (patch) | |
tree | c57e7d21a3b61acd2e1a179152dcb909ce1ececa /src/utils/stringutils.cpp | |
parent | 103aa3f43e457ebfcd32fe5ea4624539dd32978d (diff) | |
download | manaverse-654285675ececa142877d86e6f730d040625fc6e.tar.gz manaverse-654285675ececa142877d86e6f730d040625fc6e.tar.bz2 manaverse-654285675ececa142877d86e6f730d040625fc6e.tar.xz manaverse-654285675ececa142877d86e6f730d040625fc6e.zip |
Add dataPath to branding.
Diffstat (limited to 'src/utils/stringutils.cpp')
-rw-r--r-- | src/utils/stringutils.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/utils/stringutils.cpp b/src/utils/stringutils.cpp index dffec3f0c..953cbf58a 100644 --- a/src/utils/stringutils.cpp +++ b/src/utils/stringutils.cpp @@ -305,6 +305,16 @@ std::string getFileName(std::string path) return path.substr(pos + 1); } +std::string getFileDir(std::string path) +{ + size_t pos = path.rfind("/"); + if (pos == std::string::npos) + pos = path.rfind("\\"); + if (pos == std::string::npos) + return ""; + return path.substr(0, pos); +} + std::string& replaceAll(std::string& context, const std::string& from, const std::string& to) { |