Evernode setup installer. (#87)

This commit is contained in:
Ravin Perera
2022-01-05 15:17:26 +05:30
committed by GitHub
parent 3d531afd01
commit 6e59ca5f79
25 changed files with 980 additions and 536 deletions

View File

@@ -279,6 +279,26 @@ namespace util
return 0;
}
/**
* Converts given string to a uint_64. A wrapper function for std::stoull.
* @param str String variable.
* @param result Variable to store the answer from the conversion.
* @return Returns 0 in a successful conversion and -1 on error.
*/
int stoull(const std::string &str, uint64_t &result)
{
try
{
result = std::stoull(str);
}
catch (const std::exception &e)
{
// Return -1 if any exceptions are captured.
return -1;
}
return 0;
}
/**
* Construct the user contract directory path when username is given.
* @param username Username of the user.
@@ -404,7 +424,8 @@ namespace util
{
params.append(*itr);
if (std::next(itr) != input_params.end())
params.append(" ");;
params.append(" ");
;
}
const int len = 23 + (file_name.length() * 2) + params.length();
char command[len];