karolherbst / Gamekeeper-Framework

Library for hooking up game stores and merging them into one single library
GNU Lesser General Public License v2.1
2 stars 0 forks source link

implement XDGPaths.resolveFile #30

Closed karolherbst closed 10 years ago

karolherbst commented 10 years ago

currently this method always returns the default path without searching if the file actually exists

Jookia commented 10 years ago

On 10/02/14 21:51, Karol Herbst wrote:

currently this method always returns the default path without searching if the file actually exists

  • implement XDGPaths.resolveFile(const char * singlePath, const boost::filesystem::path& singleDefault, std::string fileName)
  • implement XDGPaths::resolveFile(const char * singlePath, const boost::filesystem::path& singleDefault, const char * multiPath, const char * multiDefaults, std::string fileName)
  • write unit test cases

XDG paths don't exist on Windows. Maybe this should be a bit more generic? Unless the XDG part is going to be wrapped.

karolherbst commented 10 years ago

the good thing is, that this method only relies on core::OSInformation.getEnvSeperator() so we could move that into an abstract class. We could move that into a static method too, but then we need to add another argument with the content of core::OSInformation.getEnvSeperator().

But to clarify things: we are already OS indepentent here, so the XDGPath class should also "work" on Windows. But this doesn't make much sense, because windows doesn't provide the needed environment variabloes or default paths.

On the other hand, no OSPaths implementation will need this "resolve" file method, because it is very XDG specific in this domain. I would say we should leave it here until anything else needs it. And as long as this mehtod stays precondition weak, there should be no problem.