#include<vector>
#include<string>
+#include <cstdlib>
namespace CDMUtilities
{
//break path into folders
std::vector<std::string> pathSlpit;
- splitter::split(pathSlpit, path, "/", splitter::no_empties);
+ splitter::split(pathSlpit, path, CDMUtilities::SLASH, splitter::no_empties);
for (int i = 0; i < pathSlpit.size(); i++)
{
- pathFixed += "/" + pathSlpit[i];
+ pathFixed += CDMUtilities::SLASH + pathSlpit[i];
}
#endif
return pathFixed;
}
+
+ int openTextEditor(const std::string& file)
+ {
+ std::string command = TEXT_EDITOR;
+
+ if(file != "")
+ command += " \"" + file + "\" &";
+
+ return system(command.c_str());
+ }
+
+ int openFileExplorer(const std::string& file)
+ {
+ std::string command = FILE_EXPLORER;
+
+ if(file != "")
+ command += " \"" + file + "\" &";
+
+ return system(command.c_str());
+ }
+
+ int openFileWithCommand(const std::string& file, const std::string& command)
+ {
+ std::string comm = command;
+ if(file != "")
+ comm += " \"" + file + "\" &";
+
+ return system(comm.c_str());
+ }
+
+ int openBBEditor()
+ {
+ std::string comm = "bbEditor &";
+ return system(comm.c_str());
+ }
+
+ int openCreaToolsTools()
+ {
+ std::string comm = "creaTools.sh &";
+ return system(comm.c_str());
+ }
+
+ int openTerminal()
+ {
+ std::string comm = TERMINAL + "&";
+ return system(comm.c_str());
+ }
+
}