Stan  2.14.0
probability, sampling & optimization
Functions
stanc_helper.hpp File Reference
#include <stan/version.hpp>
#include <stan/lang/compiler.hpp>
#include <stan/io/cmd_line.hpp>
#include <exception>
#include <fstream>
#include <iostream>
#include <stdexcept>
#include <string>

Go to the source code of this file.

Functions

void print_version (std::ostream *out_stream)
 Print the version of stanc with major, minor and patch. More...
 
void print_stanc_help (std::ostream *out_stream)
 Prints the Stan compiler (stanc) help. More...
 
void delete_file (std::ostream *err_stream, const std::string &file_name)
 Delte the file at the specified path, writing messages to error stream if not possible. More...
 
int stanc_helper (int argc, const char *argv[], std::ostream *out_stream, std::ostream *err_stream)
 Invoke the stanc command on the specified argument list, writing output and error messages to the specified streams, return a return code. More...
 

Function Documentation

§ delete_file()

void delete_file ( std::ostream *  err_stream,
const std::string &  file_name 
)

Delte the file at the specified path, writing messages to error stream if not possible.

Do nothing on zero size file name input. Only write to error stream if it is non-null.

Parameters
[in,out]err_streamstream to which error messages are written
[in]file_namepath of file

Definition at line 74 of file stanc_helper.hpp.

§ print_stanc_help()

void print_stanc_help ( std::ostream *  out_stream)

Prints the Stan compiler (stanc) help.

Parameters
[in,out]out_streamstream to which help is written

Definition at line 34 of file stanc_helper.hpp.

§ print_version()

void print_version ( std::ostream *  out_stream)

Print the version of stanc with major, minor and patch.

Parameters
[in,out]out_streamstream to which version is written.

Definition at line 18 of file stanc_helper.hpp.

§ stanc_helper()

int stanc_helper ( int  argc,
const char *  argv[],
std::ostream *  out_stream,
std::ostream *  err_stream 
)

Invoke the stanc command on the specified argument list, writing output and error messages to the specified streams, return a return code.

The return codes are: 0 for success, -1 for an exception, -2 is parsing failed, and -3 if there are invalid arguments.

Parameters
[in]argcnumber of arguments
[in]argvarguments
[in,out]out_streamstream to which output is written
[in,out]err_streamstream to which error messages are written
Returns
return code

Definition at line 100 of file stanc_helper.hpp.


     [ Stan Home Page ] © 2011–2016, Stan Development Team.