Audacity 3.2.0
Classes | Functions
VST3::Hosting::anonymous_namespace{module_linux.cpp} Namespace Reference

Classes

class  LinuxModule
 

Functions

Optional< std::string > getCurrentMachineName ()
 
Optional< PathgetApplicationPath ()
 
void findFilesWithExt (const std::string &path, const std::string &ext, Module::PathList &pathList, bool recursive=true)
 
void findModules (const std::string &path, Module::PathList &pathList)
 

Function Documentation

◆ findFilesWithExt()

void VST3::Hosting::anonymous_namespace{module_linux.cpp}::findFilesWithExt ( const std::string &  path,
const std::string &  ext,
Module::PathList &  pathList,
bool  recursive = true 
)

Definition at line 224 of file module_linux.cpp.

226{
227 try
228 {
229 for (auto& p : filesystem::directory_iterator (path))
230 {
231 if (p.path ().extension () == ext)
232 {
233 pathList.push_back (p.path ().generic_string ());
234 }
235 else if (recursive && p.status ().type () == filesystem::file_type::directory)
236 {
237 findFilesWithExt (p.path (), ext, pathList);
238 }
239 }
240 }
241 catch (...)
242 {
243 }
244}
void findFilesWithExt(const std::string &path, const std::string &ext, Module::PathList &pathList, bool recursive=true)

References findFilesWithExt().

Referenced by findFilesWithExt(), and findModules().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ findModules()

void VST3::Hosting::anonymous_namespace{module_linux.cpp}::findModules ( const std::string &  path,
Module::PathList &  pathList 
)

Definition at line 247 of file module_linux.cpp.

248{
249 findFilesWithExt (path, ".vst3", pathList);
250}

References findFilesWithExt().

Here is the call graph for this function:

◆ getApplicationPath()

Optional< Path > VST3::Hosting::anonymous_namespace{module_linux.cpp}::getApplicationPath ( )

Definition at line 92 of file module_linux.cpp.

93{
94 std::string appPath = "";
95
96 pid_t pid = getpid ();
97 char buf[10];
98 sprintf (buf, "%d", pid);
99 std::string _link = "/proc/";
100 _link.append (buf);
101 _link.append ("/exe");
102 char proc[1024];
103 int ch = readlink (_link.c_str (), proc, 1024);
104 if (ch == -1)
105 return {};
106
107 proc[ch] = 0;
108 appPath = proc;
109 std::string::size_type t = appPath.find_last_of ("/");
110 appPath = appPath.substr (0, t);
111
112 return Path {appPath};
113}
filesystem::path Path

◆ getCurrentMachineName()

Optional< std::string > VST3::Hosting::anonymous_namespace{module_linux.cpp}::getCurrentMachineName ( )

Definition at line 80 of file module_linux.cpp.

81{
82 struct utsname unameData;
83
84 int res = uname (&unameData);
85 if (res != 0)
86 return {};
87
88 return {unameData.machine};
89}

Referenced by VST3::Hosting::anonymous_namespace{module_linux.cpp}::LinuxModule::getSOPath().

Here is the caller graph for this function: