Import Geant4 11.4.0 source tree

This commit is contained in:
Gabriele Cosmo
2025-12-05 08:54:02 +01:00
parent a499fb82e9
commit b4a16de652
6484 changed files with 232674 additions and 221097 deletions
+16 -3
View File
@@ -4,12 +4,25 @@
#ifndef tools_get_lines
#define tools_get_lines
#include "cstr"
#include <cstdlib> // malloc,free
#include <cstring> // strcpy
#include <string>
#include <vector>
namespace tools {
namespace tools
{
inline char* str_dup(const char* a_cstr)
{
return ::strcpy((char*)::malloc(::strlen(a_cstr) + 1), a_cstr);
}
inline void str_del(char*& a_cstr)
{
if (a_cstr == NULL) return;
::free(a_cstr);
a_cstr = NULL;
}
inline void get_lines(const std::string& a_string,std::vector<std::string>& a_lines){
// a_string is a list separated by "\n" or "\\n".