version 1.30, 2005/03/25 14:56:50
|
version 1.31, 2005/05/13 20:44:15
|
|
|
// | // |
// Modified By: Carol Ann Krug Graves, Hewlett-Packard Company | // Modified By: Carol Ann Krug Graves, Hewlett-Packard Company |
// (carolann_graves@hp.com) | // (carolann_graves@hp.com) |
|
// David Dillard, VERITAS Software Corp. |
|
// (david.dillard@veritas.com) |
// | // |
//%///////////////////////////////////////////////////////////////////////////// | //%///////////////////////////////////////////////////////////////////////////// |
| |
|
|
Optarg::Value(String &s) const { s = _value; } | Optarg::Value(String &s) const { s = _value; } |
| |
// Fill in a caller-provided int with the integer conversion of the value. | // Fill in a caller-provided int with the integer conversion of the value. |
void Optarg::Value (int &i) const throw (TypeMismatchException) |
void Optarg::Value (int &i) const |
{ | { |
CString cs = _value.getCString(); | CString cs = _value.getCString(); |
const char* s = cs; | const char* s = cs; |
|
|
} | } |
| |
// Fill in a caller-provided unsigned int | // Fill in a caller-provided unsigned int |
void Optarg::Value (unsigned int &i) const throw (TypeMismatchException) |
void Optarg::Value (unsigned int &i) const |
{ | { |
CString cs = _value.getCString(); | CString cs = _value.getCString(); |
const char* s = cs; | const char* s = cs; |
|
|
if (size == 0) | if (size == 0) |
return false; | return false; |
for (unsigned int i = 0; i < size; i++) { | for (unsigned int i = 0; i < size; i++) { |
char c = opt[i]; |
char c = static_cast<char>(opt[i]); |
if ( ((i + 1) < size) && (opt[i+1] == ':') ) { | if ( ((i + 1) < size) && (opt[i+1] == ':') ) { |
if (!(addFlagspec(c, true))) { | if (!(addFlagspec(c, true))) { |
return false; | return false; |
|
|
enum states {START, ARGEXPECTED}; | enum states {START, ARGEXPECTED}; |
states state = START; | states state = START; |
for (unsigned int i = 1; i < (unsigned int)argc; i++) { | for (unsigned int i = 1; i < (unsigned int)argc; i++) { |
unsigned int endsize = strlen(argv[i]); |
unsigned int endsize = static_cast<unsigned int>(strlen(argv[i])); |
switch (state) { | switch (state) { |
case START: | case START: |
cat = catagorize(argv[i]); | cat = catagorize(argv[i]); |