PandA-2024.02
|
utility function used to read files. More...
#include "fileIO.hpp"
#include "Parameter.hpp"
#include "dbgPrintHelper.hpp"
#include "exceptions.hpp"
#include "file_IO_constants.hpp"
#include "string_manipulation.hpp"
#include <cstdlib>
#include <random>
#include <regex>
Go to the source code of this file.
Functions | |
fileIO_istreamRef | fileIO_istream_open (const std::string &name) |
this function returns an istream compressed or not. More... | |
int | PandaSystem (const ParameterConstRef Param, const std::string &system_command, bool host_exec, const std::string &output, const unsigned int type, const bool background, const size_t timeout) |
System call forcing execution with bash. More... | |
bool | NaturalVersionOrder (const std::filesystem::path &_x, const std::filesystem::path &_y) |
template<typename T > | |
void | array_rand (T *arr, size_t size) |
std::filesystem::path | unique_path (const std::filesystem::path &model) |
utility function used to read files.
Definition in file fileIO.cpp.
void array_rand | ( | T * | arr, |
size_t | size | ||
) |
Definition at line 241 of file fileIO.cpp.
Referenced by unique_path().
fileIO_istreamRef fileIO_istream_open | ( | const std::string & | name | ) |
this function returns an istream compressed or not.
It first check for a compressed file, then search for the compressed version of the file and finally in case no compressed file is found it look for the plain text file. this function is mainly based on the gzstream wrapper and on zlib library.
name | is the file name. |
Definition at line 55 of file fileIO.cpp.
References THROW_ERROR.
Referenced by AsnParser::Exec(), AadlParser::Exec(), Parameter::GetFileFormat(), and TestVectorParser::ParseXMLFile().
bool NaturalVersionOrder | ( | const std::filesystem::path & | _x, |
const std::filesystem::path & | _y | ||
) |
Definition at line 195 of file fileIO.cpp.
References distance(), and x.
Referenced by BambuParameter::CheckParameters(), EucalyptusParameter::CheckParameters(), and CopyFile().
int PandaSystem | ( | const ParameterConstRef | Param, |
const std::string & | system_command, | ||
bool | host_exec = true , |
||
const std::string & | output = "" , |
||
const unsigned int | type = 3 , |
||
const bool | background = false , |
||
const size_t | timeout = 0 |
||
) |
System call forcing execution with bash.
Param | is the set of input parameters |
system_command | is the to be executed |
host_exec | specifies if the executable is expected to be in the host system or distributed within the AppImage |
output | is the file where output has to be saved |
type | specifies which streams have to be saved; possible values are 0 (none), 1 (stdout), 2 (stderr), 3(stdout and stderr) |
background | specifies if the command has to be executed in background |
timeout | is the timeout for the command (in minutes) |
Definition at line 78 of file fileIO.cpp.
References test_panda::command, counter, GetCurrentPath(), GetPath(), OUTPUT_LEVEL_PEDANTIC, STR, STR_CST_file_IO_shell_output_file, STR_CST_file_IO_shell_script, THROW_ASSERT, and THROW_UNREACHABLE.
Referenced by CompilerWrapper::CompileFile(), CopyFile(), CompilerWrapper::CreateExecutable(), CTestbenchExecution::Exec(), BasicBlocksProfiling::Exec(), create_tree_manager::Exec(), ToolManager::execute_command(), FindMaxTransformations::ExecuteBambu(), NonDeterministicFlows::ExecuteTool(), XilinxTasteBackendFlow::GenerateSynthesisScripts(), CompilerWrapper::GetSystemIncludes(), main(), and CompilerWrapper::QueryCompilerConfig().
std::filesystem::path unique_path | ( | const std::filesystem::path & | model | ) |
Definition at line 286 of file fileIO.cpp.
References array_rand(), and ran.
Referenced by BambuParameter::CheckParameters(), CompilerWrapper::CompileFile(), CopyFile(), CompilerWrapper::FillTreeManager(), main(), and Parameter::ManageDefaultOptions().