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

Define CBArgv class. More...

#include <string.h>

Go to the source code of this file.

Classes

struct  CBArgv
 Argument vector to tokenize them. This is used by the command line parser (CBParseCommandLine). More...

Functions

void CBInitArgv (struct CBArgv *dst, unsigned int argc, const char **argv)
 Initialize CBArgv data.
static unsigned int CBIsEndOfArgv (const struct CBArgv *src)
 Check the all arguments are poped or not.
unsigned int CBHasLongNameOption (const struct CBArgv *src)
 Check the next token is long-name-option or not.
unsigned int CBHasShortNameOption (const struct CBArgv *src)
 Check the next token is short-name-option or not.
void CBSkipDashesInArgv (struct CBArgv *src)
 Skip 1 or 2 dashes from the current word.
static const char * CBCurrentWordInArgv (const struct CBArgv *src)
 Peek current word.
void CBPopWordInArgv (struct CBArgv *src)
 Drop current word and get next as current.
char CBCurrentCharInArgv (struct CBArgv *src)
 Get a character from current word.
void CBPopCharInArgv (struct CBArgv *src)
 Pop a character from current word.

Detailed Description

Define CBArgv class.

Copyright
Copyright (C) 2012 Steel Wheels Project

Function Documentation

char CBCurrentCharInArgv ( struct CBArgv src)

Get a character from current word.

Parameters:
srcSource argument vector
static const char* CBCurrentWordInArgv ( const struct CBArgv src) [inline, static]

Peek current word.

Returns:
Current word
Parameters:
srcSource argument vector
unsigned int CBHasLongNameOption ( const struct CBArgv src)

Check the next token is long-name-option or not.

Return values:
TRUEThe next token is started by '--'
FALSEThe next token is not '--'
Parameters:
srcSource argument vector
unsigned int CBHasShortNameOption ( const struct CBArgv src)

Check the next token is short-name-option or not.

Return values:
TRUEThe next token is started by '-'
FALSEThe next token is not '-'
Parameters:
srcSource argument vector
void CBInitArgv ( struct CBArgv dst,
unsigned int  argc,
const char **  argv 
)

Initialize CBArgv data.

Parameters:
dstDestination object
argcCount of arguments
argvVector of arguments
static unsigned int CBIsEndOfArgv ( const struct CBArgv src) [inline, static]

Check the all arguments are poped or not.

Return values:
TRUEAll arguments are poped
FALSESome arguments are remain before poping
void CBPopCharInArgv ( struct CBArgv src)

Pop a character from current word.

Parameters:
srcSource argument vector
void CBPopWordInArgv ( struct CBArgv src)

Drop current word and get next as current.

Parameters:
srcSource argument vector
void CBSkipDashesInArgv ( struct CBArgv src)

Skip 1 or 2 dashes from the current word.

Parameters:
srcSource argumen vector
 All Classes Files Functions Variables Enumerations Enumerator Defines