AsmGrader 0.0.0
Loading...
Searching...
No Matches
asmgrader::ProgramOptions Struct Reference

#include <program_options.hpp>

Public Types

enum class  VerbosityLevel {
  Silent , Quiet , Summary , FailsOnly ,
  All , Extra , Max
}
 See Description of Levels for an explaination of each of the levels. Max is just used as a sentinal for now. More...
 
enum class  StopOpt { Never , FirstError , EachTestError }
 Never = stop only on fatal errors FirstError = stop completely on the first error encountered EachTestError = stop each test early upon error, but still attempt to run subsequent tests. More...
 
enum class  ColorizeOpt { Auto , Always , Never }
 

Public Member Functions

Expected< void, std::string > validate ()
 Verify that all fields are valid.
 

Static Public Member Functions

static Expected< void, std::string > ensure_file_exists (const std::filesystem::path &path, fmt::format_string< std::string > fmt)
 
static Expected< void, std::string > ensure_is_regular_file (const std::filesystem::path &path, fmt::format_string< std::string > fmt)
 
static Expected< void, std::string > ensure_is_directory (const std::filesystem::path &path, fmt::format_string< std::string > fmt)
 

Public Attributes

enum asmgrader::ProgramOptions::VerbosityLevel verbosity = DEFAULT_VERBOSITY_LEVEL
 
std::string assignment_name
 
enum asmgrader::ProgramOptions::StopOpt stop_option
 
enum asmgrader::ProgramOptions::ColorizeOpt colorize_option
 
std::optional< std::string > file_name
 
std::string file_matcher = std::string{DEFAULT_FILE_MATCHER}
 
std::filesystem::path database_path = DEFAULT_DATABASE_PATH
 
std::filesystem::path search_path = DEFAULT_SEARCH_PATH
 

Static Public Attributes

static constexpr std::string_view DEFAULT_DATABASE_PATH = "students.csv"
 
static constexpr std::string_view DEFAULT_SEARCH_PATH = "."
 
static constexpr std::string_view DEFAULT_FILE_MATCHER = AssignmentFileSearcher::DEFAULT_REGEX
 
static constexpr auto DEFAULT_VERBOSITY_LEVEL = VerbosityLevel::Summary
 

Member Enumeration Documentation

◆ ColorizeOpt

Enumerator
Auto 
Always 
Never 

◆ StopOpt

Never = stop only on fatal errors FirstError = stop completely on the first error encountered EachTestError = stop each test early upon error, but still attempt to run subsequent tests.

Enumerator
Never 
FirstError 
EachTestError 

◆ VerbosityLevel

See Description of Levels for an explaination of each of the levels. Max is just used as a sentinal for now.

Enumerator
Silent 

Silent

Quiet 

Quiet

Summary 

Summary (default)

FailsOnly 

FailsOnly

All 

All

Extra 

Extra

Max 

Max

Member Function Documentation

◆ ensure_file_exists()

static Expected< void, std::string > asmgrader::ProgramOptions::ensure_file_exists ( const std::filesystem::path & path,
fmt::format_string< std::string > fmt )
inlinestatic

◆ ensure_is_directory()

static Expected< void, std::string > asmgrader::ProgramOptions::ensure_is_directory ( const std::filesystem::path & path,
fmt::format_string< std::string > fmt )
inlinestatic

◆ ensure_is_regular_file()

static Expected< void, std::string > asmgrader::ProgramOptions::ensure_is_regular_file ( const std::filesystem::path & path,
fmt::format_string< std::string > fmt )
inlinestatic

◆ validate()

Expected< void, std::string > asmgrader::ProgramOptions::validate ( )
inline

Verify that all fields are valid.

Member Data Documentation

◆ assignment_name

std::string asmgrader::ProgramOptions::assignment_name

◆ colorize_option

enum asmgrader::ProgramOptions::ColorizeOpt asmgrader::ProgramOptions::colorize_option

◆ database_path

std::filesystem::path asmgrader::ProgramOptions::database_path = DEFAULT_DATABASE_PATH

◆ DEFAULT_DATABASE_PATH

std::string_view asmgrader::ProgramOptions::DEFAULT_DATABASE_PATH = "students.csv"
staticconstexpr

◆ DEFAULT_FILE_MATCHER

std::string_view asmgrader::ProgramOptions::DEFAULT_FILE_MATCHER = AssignmentFileSearcher::DEFAULT_REGEX
staticconstexpr

◆ DEFAULT_SEARCH_PATH

std::string_view asmgrader::ProgramOptions::DEFAULT_SEARCH_PATH = "."
staticconstexpr

◆ DEFAULT_VERBOSITY_LEVEL

auto asmgrader::ProgramOptions::DEFAULT_VERBOSITY_LEVEL = VerbosityLevel::Summary
staticconstexpr

◆ file_matcher

std::string asmgrader::ProgramOptions::file_matcher = std::string{DEFAULT_FILE_MATCHER}

◆ file_name

std::optional<std::string> asmgrader::ProgramOptions::file_name

◆ search_path

std::filesystem::path asmgrader::ProgramOptions::search_path = DEFAULT_SEARCH_PATH

◆ stop_option

enum asmgrader::ProgramOptions::StopOpt asmgrader::ProgramOptions::stop_option

◆ verbosity

enum asmgrader::ProgramOptions::VerbosityLevel asmgrader::ProgramOptions::verbosity = DEFAULT_VERBOSITY_LEVEL

The documentation for this struct was generated from the following file: