Skip to content
Snippets Groups Projects
Commit e28002a1 authored by Tristan Matthews's avatar Tristan Matthews
Browse files

fileutils: keep functions out of global namespace

parent 0661b858
No related branches found
No related tags found
No related merge requests found
......@@ -155,7 +155,7 @@ std::vector<sfl::Codec*> AudioCodecFactory::scanCodecDirectory()
if (envDir)
dirToScan.push_back(std::string(envDir) + DIR_SEPARATOR_STR);
const char *progDir = get_program_dir();
const char *progDir = fileutils::get_program_dir();
if (progDir)
dirToScan.push_back(std::string(progDir) + DIR_SEPARATOR_STR + "audio/codecs/");
......
......@@ -31,6 +31,7 @@
#include <libgen.h>
#include <cstdlib>
namespace fileutils {
static char *program_dir = NULL;
void set_program_dir(char *program_path)
......@@ -42,3 +43,5 @@ const char *get_program_dir()
{
return program_dir;
}
}
......@@ -31,7 +31,9 @@
#ifndef __FILEUTILS_H__
#define __FILEUTILS_H__
void set_program_dir(char *program_path);
const char *get_program_dir();
namespace fileutils {
void set_program_dir(char *program_path);
const char *get_program_dir();
}
#endif // __FILEUTILS_H__
......@@ -78,7 +78,7 @@ static bool check_dir(const char *path)
int
main(int argc, char **argv)
{
set_program_dir(argv[0]);
fileutils::set_program_dir(argv[0]);
// makeCommandOptionParse allocates the object with operator new, so
// auto_ptr is fine in this context.
// TODO: This should eventually be replaced with std::unique_ptr for C++0x
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment