Way to many changes, new start
This commit is contained in:
parent
63904bec07
commit
a95d18c761
25 changed files with 1799 additions and 334 deletions
BIN
scripts/test/test
Executable file
BIN
scripts/test/test
Executable file
Binary file not shown.
43
scripts/test/test.cpp
Normal file
43
scripts/test/test.cpp
Normal file
|
@ -0,0 +1,43 @@
|
|||
#include <filesystem>
|
||||
#include <iostream>
|
||||
#include <string>
|
||||
#include <fstream>
|
||||
|
||||
namespace fs = std::filesystem;
|
||||
|
||||
const std::string dir = "/usr/share/applications";
|
||||
|
||||
int main(int argc, char const *argv[])
|
||||
{
|
||||
for (const auto& entry : fs::directory_iterator(dir))
|
||||
{
|
||||
if (entry.path().extension() == ".desktop")
|
||||
{
|
||||
std::ifstream file(entry.path());
|
||||
if (!file.is_open())
|
||||
{
|
||||
std::cerr << "file not opened" << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
std::string output;
|
||||
std::string line;
|
||||
|
||||
while (std::getline(file, line))
|
||||
{
|
||||
output += line + "\n";
|
||||
}
|
||||
|
||||
|
||||
std::cout << output << std::endl;
|
||||
|
||||
file.close();
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue