Sha256: 2c469b0c56a678f897b7be70725be48db5ed664786f193118b98586ce995bd76

Contents?: true

Size: 867 Bytes

Versions: 16

Compression:

Stored size: 867 Bytes

Contents

#include <leatherman/windows/file_util.hpp>
#include <leatherman/windows/system_error.hpp>
#include <leatherman/windows/windows.hpp>
#include <leatherman/locale/locale.hpp>
#include <boost/filesystem.hpp>

#include <shlobj.h>

// Mark string for translation (alias for leatherman::locale::format)
using leatherman::locale::_;

using namespace std;
using namespace boost::filesystem;

namespace leatherman { namespace windows { namespace file_util {

    string get_programdata_dir() {
        PWSTR pdir;
        if (SUCCEEDED(SHGetKnownFolderPath(FOLDERID_ProgramData, 0, nullptr, &pdir))) {
            auto p = path(pdir);
            return p.string();
        }
        throw unknown_folder_exception(_("error finding FOLDERID_ProgramData: {1}",
                    leatherman::windows::system_error()));
    }

}}}  // namespace leatherman::windows::file_util

Version data entries

16 entries across 16 versions & 2 rubygems

Version Path
facter-3.12.2.cfacter.20181217 ext/facter/leatherman/windows/src/file_util.cc
facter-3.12.1.cfacter.20181031 ext/facter/leatherman/windows/src/file_util.cc
facter-3.11.6.cfacter.20181031 ext/facter/leatherman/windows/src/file_util.cc
facter-3.12.1.cfacter.20181023 ext/facter/leatherman/windows/src/file_util.cc
facter-3.11.5.cfacter.20181022 ext/facter/leatherman/windows/src/file_util.cc
facter-3.12.0.cfacter.20181004 ext/facter/leatherman/windows/src/file_util.cc
facter-3.12.0.cfacter.20181001 ext/facter/leatherman/windows/src/file_util.cc
facter-3.12.0.cfacter.20180918 ext/facter/leatherman/windows/src/file_util.cc
facter-3.11.4.cfacter.20180821 ext/facter/leatherman/windows/src/file_util.cc
facter-3.11.3.cfacter.20180716 ext/facter/leatherman/windows/src/file_util.cc
facter-3.11.2.cfacter.20180612 ext/facter/leatherman/windows/src/file_util.cc
facter-3.9.6.cfacter.20180612 ext/facter/leatherman/windows/src/file_util.cc
facter-3.11.2.cfacter.20180606 ext/facter/leatherman/windows/src/file_util.cc
facter-3.9.6.cfacter.20180606 ext/facter/leatherman/windows/src/file_util.cc
facter-3.11.0.cfacter.20180319 ext/facter/leatherman/windows/src/file_util.cc
cfacter-3.11.0.rc.20180314 ext/facter/leatherman/windows/src/file_util.cc