MCPcopy Create free account
hub / github.com/DISTRHO/Cardinal / getSpecialPath

Function getSpecialPath

src/CardinalCommon.cpp:887–917  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

885
886#ifdef ARCH_WIN
887std::string getSpecialPath(const SpecialPath type)
888{
889 int csidl;
890 switch (type)
891 {
892 case kSpecialPathUserProfile:
893 csidl = CSIDL_PROFILE;
894 break;
895 case kSpecialPathCommonProgramFiles:
896 csidl = CSIDL_PROGRAM_FILES_COMMON;
897 break;
898 case kSpecialPathProgramFiles:
899 csidl = CSIDL_PROGRAM_FILES;
900 break;
901 case kSpecialPathAppData:
902 csidl = CSIDL_APPDATA;
903 break;
904 case kSpecialPathMyDocuments:
905 csidl = CSIDL_MYDOCUMENTS;
906 break;
907 default:
908 return {};
909 }
910
911 WCHAR path[MAX_PATH] = {};
912
913 if (SHGetFolderPathW(nullptr, csidl, nullptr, SHGFP_TYPE_CURRENT, path) == S_OK)
914 return string::UTF16toUTF8(path);
915
916 return {};
917}
918#endif
919
920#ifdef DISTRHO_OS_WASM

Callers 9

CardinalCommon.cppFile · 0.70
homeDirFunction · 0.70
getPathForLADSPAFunction · 0.50
getPathForDSSIFunction · 0.50
getPathForLV2Function · 0.50
getPathForVST2Function · 0.50
getPathForVST3Function · 0.50
getPathForCLAPFunction · 0.50
getPathForJSFXFunction · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected