109 filese = fopen(filename.c_str(),
"r");
112 while((nBytes = fread(buffer, 1,
sizeof(buffer), filese)) > 0)
114 size_t wBytes = fwrite(buffer, 1, nBytes,
stdout);
125 std::string current_dir;
128 current_dir = getenv(
"OWD");
132 current_dir = std::filesystem::current_path().string();
135 boost::replace_all(current_dir,
"\\",
"/");
140 inline std::string
GetPath(std::filesystem::path path)
142 if(path.is_relative())
146 return path.string();
151 if(getenv(
"MINGW_INST_DIR"))
155 const auto app_prefix = getenv(
"MINGW_INST_DIR");
156 return app_prefix + path;
158 return "$MINGW_INST_DIR" + path;
160 else if(getenv(
"APPDIR"))
164 const auto app_prefix = getenv(
"APPDIR");
165 return app_prefix + path;
167 return "$APPDIR" + path;
172 return "c:/msys64/" + path;
187 inline void CopyFile(std::filesystem::path file_source, std::filesystem::path file_target)
189 if(file_source.string() ==
"-")
192 std::ofstream new_file(file_target.string().c_str());
195 std::getline(std::cin, line);
196 new_file << line << std::endl;
201 std::filesystem::copy_file(file_source, file_target, std::filesystem::copy_options::overwrite_existing);
218 const std::string&
output =
"",
const unsigned int type = 3,
const bool background =
false,
219 const size_t timeout = 0);
221 bool NaturalVersionOrder(
const std::filesystem::path& _x,
const std::filesystem::path& _y);
fileIO_ostreamRef fileIO_ostream_open(const std::string &name)
this function returns an ostream compressed or not.
refcount< std::istream > fileIO_istreamRef
RefCount type definition for the input stream object.
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.
fileIO_istreamRef fileIO_istream_open_from_string(const std::string &input)
Create a fileIO_istreamRef starting from a string.
volatile int output[DIM_Y][DIM_X]
void line(int x1, int y1, int x2, int y2, unsigned int color)
refcount< std::ostream > fileIO_ostreamRef
RefCount type definition for the input stream object.
bool NaturalVersionOrder(const std::filesystem::path &_x, const std::filesystem::path &_y)
void CopyFile(std::filesystem::path file_source, std::filesystem::path file_target)
Copy file; if target already exist, overwrite.
fileIO_istreamRef fileIO_istream_open(const std::string &name)
this function returns an istream compressed or not.
Template definition of refcount.
CONSTREF_FORWARD_DECL(Parameter)
std::string GetPath(std::filesystem::path path)
Template borrowed from the ANTLR library by Terence Parr (http://www.jGuru.com - Software rights: htt...
std::string GetCurrentPath()
void CopyStdout(const std::string &filename)
Copy a file to the standard output.
std::filesystem::path unique_path(const std::filesystem::path &model)
std::string relocate_compiler_path(const std::string &path, bool resolve_path=false)