Options

Author:
Armin Trattnig
Version:
1.0
Includes:
<ctype.h>
<stdio.h>
<stdlib.h>
"StringUtils.h"
"Logger.h"

Introduction

Provides commandline parsing

Updated:
Friday, December 05, 2014


Functions

freeOptions
parseArguments
printOptions
printUsage
setDefaultValues

freeOptions


static inline void freeOptions (
    Options *options) 
Parameters
options

Pointer to an option structure

Discussion

Deallocates the contents of option


parseArguments


static inline bool parseArguments (
    int argc,
    char **argv,
    Options *options) 
Parameters
argc

argc from main (Number of arguments)

argv

argv from main (Actual argument strings)

options

Pointer to an option structure

Return Value

false, if there are errors. ture, if everything was ok

Discussion

Parses the arguments given with the command line and sets the fields of options


printOptions


static inline void printOptions (
    Options *options) 
Parameters
options

Pointer to an option structure

Discussion

Prints the contents of the fields in options


printUsage


static inline void printUsage () 
Discussion

Prints the usage of the fields in options


setDefaultValues


static inline void setDefaultValues (
    Options *options) 
Parameters
options

Pointer to an option structure

Discussion

Sets the fields of an option structure to default values


Typedefs

DISOIFF_ToolMode

Mode for choosing what feature of the tool to use

ISOIFF_ToolMode

Mode for choosing what feature of the tool to use

Options

Options, which can be parsed from the commandline.


DISOIFF_ToolMode


Mode for choosing what feature of the tool to use

Constants
ISOIFF_ToolMode_Write

Reading HEVC Bitstream and creating ISO Media Based Image File Format

ISOIFF_ToolMode_Read

Reading ISO Media Based Image File Format and creating HEVC Bitstream

ISOIFF_ToolMode_NotSet

Indicates that a mode has not been set

See Also


ISOIFF_ToolMode


Mode for choosing what feature of the tool to use

Constants
ISOIFF_ToolMode_Write

Reading HEVC Bitstream and creating ISO Media Based Image File Format

ISOIFF_ToolMode_Read

Reading ISO Media Based Image File Format and creating HEVC Bitstream

ISOIFF_ToolMode_NotSet

Indicates that a mode has not been set

See Also


Options


Options, which can be parsed from the commandline.

typedef struct OptionsStruct { 
    ISOIFF_ToolMode mode; 
    char *inputFile; 
    char *outputFile; 
    int debugLevel; 
    bool isJustAskingForHelp; 
    int width; 
    int height; 
} Options;  
Fields
mode

Mode for choosing what feature of the tool to use

inputFile

File, from which input data is read

outputFile

File, to which the output data is written

debugLevel

Debug level, controls the detail of logging output

isJustAskingForHelp

Flag, for indication that the -h for help has been requested.

See Also


Structs and Unions

OptionsStruct

Options, which can be parsed from the commandline.


OptionsStruct


Options, which can be parsed from the commandline.

typedef struct OptionsStruct { 
    ISOIFF_ToolMode mode; 
    char *inputFile; 
    char *outputFile; 
    int debugLevel; 
    bool isJustAskingForHelp; 
    int width; 
    int height; 
} Options;  
Fields
mode

Mode for choosing what feature of the tool to use

inputFile

File, from which input data is read

outputFile

File, to which the output data is written

debugLevel

Debug level, controls the detail of logging output

isJustAskingForHelp

Flag, for indication that the -h for help has been requested.

See Also