diff options
Diffstat (limited to 'src/resources/beingcommon.cpp')
-rw-r--r-- | src/resources/beingcommon.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/resources/beingcommon.cpp b/src/resources/beingcommon.cpp index 174a6edfd..5647d01e3 100644 --- a/src/resources/beingcommon.cpp +++ b/src/resources/beingcommon.cpp @@ -20,8 +20,14 @@ #include "resources/beingcommon.h" +#include "utils/files.h" +#include "utils/physfstools.h" +#include "utils/stringutils.h" + #include "resources/beinginfo.h" +#include <algorithm> + #include "debug.h" void BeingCommon::readBasicAttributes(BeingInfo *const info, XmlNodePtr node, @@ -42,3 +48,17 @@ void BeingCommon::readBasicAttributes(BeingInfo *const info, XmlNodePtr node, info->setHpBarOffsetX(XML::getProperty(node, "hpBarOffsetX", 0)); info->setHpBarOffsetY(XML::getProperty(node, "hpBarOffsetY", 0)); } + +void BeingCommon::getIncludeFiles(const std::string &dir, StringVect &list) +{ + const std::string path = dir + PhysFs::getDirSeparator(); + StringVect tempList; + Files::getFilesWithDir(path, tempList); + FOR_EACH (StringVectCIter, it, tempList) + { + const std::string &str = *it; + if (findLast(str, ".xml")) + list.push_back(str); + } + std::sort(list.begin(), list.end()); +} |