Cobalt Framework  beta
Console application support
Classes | Enumerations | Functions
CBError.h File Reference

Define CBError data structure. More...

#include <Coconut/Coconut.h>

Go to the source code of this file.

Classes

struct  CBError
 Error information stored by the command line parer. More...

Enumerations

enum  CBErrorType {
  CBNoError = 0, CBNoDefaultCommand, CBInvalidLongOptionName, CBInvalidShortOptionName,
  CBNoParameterForLongOptionName, CBNoParameterForShortOptionName
}
 Type of command line parser error. More...

Functions

static void CBSetNoDefaultCommandError (struct CBError *dst)
 Set "No default command" error.
static void CBSetInvalidLongNameOption (struct CBError *dst, const char *optname)
 Set "Invalid long name option" error.
static void CBSetInvalidShortNameOption (struct CBError *dst, char optchar)
 Set "Invalid short name option" error.
static void CBSetNoParameterForLongNameOption (struct CBError *dst, const char *optname)
 Set "No parameter for long name option" error.
static void CBSetNoParameterForShortNameOption (struct CBError *dst, char optchar)
 Set "No parameter for short name option" error.
struct CNString * CBErrorToString (const struct CBError *src, struct CNResource *resource)
 Get error message from error info.

Detailed Description

Define CBError data structure.

Copyright
Copyright (C) 2012 Steel Wheels Project

Enumeration Type Documentation

Type of command line parser error.

Enumerator:
CBNoError 

No error code.


Function Documentation

struct CNString* CBErrorToString ( const struct CBError src,
struct CNResource *  resource 
) [read]

Get error message from error info.

Return values:
strError message
NULLFailed to allocate error message
Parameters:
srcSource error information
resourceResource to allocate result string
static void CBSetInvalidLongNameOption ( struct CBError dst,
const char *  optname 
) [inline, static]

Set "Invalid long name option" error.

Parameters:
dstDestination error info
optnameThe option name which occurres error
static void CBSetInvalidShortNameOption ( struct CBError dst,
char  optchar 
) [inline, static]

Set "Invalid short name option" error.

Parameters:
dstDestination error info
optcharThe option name which occurres error
static void CBSetNoDefaultCommandError ( struct CBError dst) [inline, static]

Set "No default command" error.

Parameters:
dstDestination error info
static void CBSetNoParameterForLongNameOption ( struct CBError dst,
const char *  optname 
) [inline, static]

Set "No parameter for long name option" error.

Parameters:
dstDestination error info
optnameThe option name which occurres error
static void CBSetNoParameterForShortNameOption ( struct CBError dst,
char  optchar 
) [inline, static]

Set "No parameter for short name option" error.

Parameters:
dstDestination error info
optcharThe option name which occurres error
 All Classes Files Functions Variables Enumerations Enumerator Defines