mirror of
https://github.com/hyperion-project/hyperion.ng.git
synced 2025-03-01 10:33:28 +00:00
refactoring of webui and event based websocket layer (#219)
* make hyperion websocket api event based * implement new websocket handling for generalconf * migrate all webui stuff to new event based websocket api some cleanup ... now all html templates are in content refactoring of web stuff * add hyperionport to global start impl. removing advanced key * separate dashboard serverinfo is updated every 3 seconds automatily add input selection cleanup and remove not needed stuff * prepare infrastructure for server sided file execution * webui minor fixes * fix compile
This commit is contained in:
35
libsrc/utils/FileUtils.cpp
Normal file
35
libsrc/utils/FileUtils.cpp
Normal file
@@ -0,0 +1,35 @@
|
||||
#include <utils/FileUtils.h>
|
||||
|
||||
#include <cstdio>
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
#include <stdexcept>
|
||||
|
||||
#include <QFileInfo>
|
||||
|
||||
namespace FileUtils {
|
||||
|
||||
std::string getBaseName( std::string sourceFile)
|
||||
{
|
||||
QFileInfo fi( sourceFile.c_str() );
|
||||
return fi.fileName().toStdString();
|
||||
}
|
||||
|
||||
std::string command_exec(const char* cmd)
|
||||
{
|
||||
char buffer[128];
|
||||
std::string result = "";
|
||||
std::shared_ptr<FILE> pipe(popen(cmd, "r"), pclose);
|
||||
if (pipe)
|
||||
{
|
||||
while (!feof(pipe.get()))
|
||||
{
|
||||
if (fgets(buffer, 128, pipe.get()) != NULL)
|
||||
result += buffer;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
};
|
Reference in New Issue
Block a user