mirror of
https://git.jami.net/savoirfairelinux/jami-daemon.git
synced 2025-08-07 22:02:12 +08:00
fileutils: keep functions out of global namespace
This commit is contained in:
@ -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
|
||||
|
Reference in New Issue
Block a user