Euphoria
filesystem.cc
Go to the documentation of this file.
1 #include "window/filesystem.h"
2 
3 #include "SDL_filesystem.h"
4 
5 namespace eu::window
6 {
7  std::string
9  {
10  char* base_path = SDL_GetBasePath();
11  if(base_path != nullptr)
12  {
13  std::string r = base_path;
14  SDL_free(base_path); // NOLINT sdl code so free is allowed
15  return r;
16  }
17  else
18  {
19  return "./";
20  }
21  }
22 
23  std::string
25  {
26  char* base_path = SDL_GetPrefPath("madeso", "euphoria demo");
27  if(base_path != nullptr)
28  {
29  std::string pref_path = base_path;
30  SDL_free(base_path); // NOLINT sdl code so free is allowed
31  return pref_path;
32  }
33  else
34  {
35  return "";
36  }
37  }
38 }
std::string get_base_path()
Definition: filesystem.cc:8
std::string get_preference_path()
Definition: filesystem.cc:24