Logo Search packages:      
Sourcecode: pan version File versions

std::string pan::file::get_pan_home (  ) 

Returns the home pan directory, which falls back to $HOME/.pan2 if the PAN_HOME environmental variable isn't set.

Definition at line 55 of file file-util.cc.

References ensure_dir_exists().

Referenced by pan::GUI::GUI().

{
  static std::string pan_home;
  if (pan_home.empty())
  {
    const char * env_str = g_getenv ("PAN_HOME");
    if (env_str && *env_str)
      pan_home = env_str;
    else {
      char * pch = g_build_filename (g_get_home_dir(), ".pan2", NULL);
      pan_home = pch;
      g_free (pch);
    }
  }
                                                                                                                                
  file :: ensure_dir_exists (pan_home);
  return pan_home;
}


Generated by  Doxygen 1.6.0   Back to index