Pol  Revision:4b29d2b
ProgramConfig.cpp
Go to the documentation of this file.
1 #include "ProgramConfig.h"
2 #include "pol_global_config.h"
3 #include "pol_revision.h"
4 #include <string>
5 
6 namespace Pol
7 {
8 namespace Clib
9 {
10 using namespace std;
11 
13 
14 std::string ProgramConfig::m_programName = "";
15 std::string ProgramConfig::m_programDir = "";
16 
18 
21 
23 
24 void ProgramConfig::configureProgramEnvironment( const std::string& programName )
25 {
26  m_programName = programName;
27 
28  std::string exeDir = programName;
29  std::string::size_type bslashpos;
30  while ( std::string::npos != ( bslashpos = exeDir.find( '\\' ) ) )
31  {
32  exeDir.replace( bslashpos, 1, 1, '/' );
33  }
34 
35  std::string::size_type pos = exeDir.find_last_of( '/' );
36  if ( pos != std::string::npos )
37  {
38  exeDir.erase( pos );
39  exeDir += "/";
40  }
41  m_programDir = exeDir;
42 }
43 
45 {
46  return m_programName;
47 }
48 
50 {
51  return m_programDir;
52 }
53 
55 {
56  return POL_BUILD_TARGET;
57 }
58 
60 {
61  return POL_BUILD_DATETIME;
62 }
63 
65 }
66 } // namespaces
static std::string m_programName
Definition: ProgramConfig.h:34
STL namespace.
static std::string programName()
Returns the name of the currently running program.
static void configureProgramEnvironment(const std::string &programName)
Configures the bug reporting system.
static std::string m_programDir
Definition: ProgramConfig.h:35
static std::string programDir()
Returns the directory of the currently running program.
static std::string build_target()
Definition: berror.cpp:12
static std::string build_datetime()