Reimplemented absolute_path using platform::path_join for portability

This commit is contained in:
Karl Hammond
2022-10-03 15:15:15 -05:00
parent 6a2023e7df
commit aff58465f2
2 changed files with 51 additions and 1 deletions

View File

@ -45,6 +45,19 @@ double f_lammps_extract_variable_equal();
double f_lammps_extract_variable_atom(int);
double f_lammps_extract_variable_vector(int);
void f_lammps_set_variable_string();
char* c_path_join(const char*, const char*);
}
char* c_path_join(const char* a, const char* b)
{
std::string A = a;
std::string B = b;
std::string C = LAMMPS_NS::platform::path_join(A, B);
size_t length = C.length() + 1;
char *retval = (char*) malloc(length*sizeof(char));
C.copy(retval, length);
retval[length-1] = '\0';
return retval;
}
class LAMMPS_extract_variable : public ::testing::Test {