Open ericpassmore opened 1 year ago
I think something more like https://github.com/EOSIO/abieos/pull/60 where the abi is provided as an abi file would be better.
I think something more like EOSIO/abieos#60 where the abi is provided as an abi file would be better.
Good example, I can switch to a file to ABI, and I move the executables to tools directory.
Ok to use c++ to read the file? Specifically using std::filesystem::file_size
for the file size, preallocating a byte vector, std::ifstream::read
to populate the vector, then converting to string? The C-style malloc/free isn't my favorite.
I think same location of executes as name
is good.
Yes, please use C++ instead of C constructs for this including cout/cerr
over fprintf
.
fwiw a small, simple, but inefficient way I've used to read in a small file to a string is something like
std::string filename = "foo.file";
std::ifstream ifs(filename);
std::string string_of_file_contents((std::istreambuf_iterator<char>(ifs)), std::istreambuf_iterator<char>());
(inefficiency doesn't really matter for simple stuff like this)
I think same location of executes as
name
is good. Yes, please use C++ instead of C constructs for this includingcout/cerr
overfprintf
.
Got it, I will C++'ify the code. Thanks for the simple approach to reading a small file. I'll take it.
Created two command line programs
Used this for generating test data for eosjs