Zeth - Zerocash on Ethereum  0.8
Reference implementation of the Zeth protocol by Clearmatics
Classes | Functions
libtool Namespace Reference

Utilities that are likely to be useful for command line tools. More...

Classes

class  command
 Represents a top-level command, implementing parsing of global options. More...
 
class  subcommand
 Class representing a tool subcommand. More...
 

Functions

template<typename GlobalOptionsT >
int run_command (command< GlobalOptionsT > &command, GlobalOptionsT &options, const std::map< std::string, subcommand< GlobalOptionsT > * > &subcommands, int argc, char **argv)
 
std::ifstream open_binary_input_file (const std::string &filename)
 
std::ofstream open_binary_output_file (const std::string &filename)
 Utility function to open a binary file for writing, with appropriate flags. More...
 

Detailed Description

Utilities that are likely to be useful for command line tools.

Function Documentation

◆ open_binary_input_file()

std::ifstream libtool::open_binary_input_file ( const std::string &  filename)

Utility function to open a file for reading, with appropriate flags and exception handling enabled.

Definition at line 10 of file tool_util.cpp.

11 {
12  std::ifstream in_s(
13  filename.c_str(), std::ios_base::in | std::ios_base::binary);
14  in_s.exceptions(
15  std::ios_base::eofbit | std::ios_base::badbit | std::ios_base::failbit);
16  return in_s;
17 }
Here is the caller graph for this function:

◆ open_binary_output_file()

std::ofstream libtool::open_binary_output_file ( const std::string &  filename)

Utility function to open a binary file for writing, with appropriate flags.

Definition at line 19 of file tool_util.cpp.

20 {
21  std::ofstream out_s(
22  filename.c_str(), std::ios_base::out | std::ios_base::binary);
23  return out_s;
24 }
Here is the caller graph for this function:

◆ run_command()

template<typename GlobalOptionsT >
int libtool::run_command ( command< GlobalOptionsT > &  command,
GlobalOptionsT &  options,
const std::map< std::string, subcommand< GlobalOptionsT > * > &  subcommands,
int  argc,
char **  argv 
)

Execute a command object, with some global options object (initialized to default values), supporting the given set of subcommands.

Here is the caller graph for this function:
analyzer.parse_r1cs.filename
string filename
Definition: parse_r1cs.py:111