Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
TPF
jmess
Commits
31da3159
Commit
31da3159
authored
Jun 22, 2007
by
jcaceres
Browse files
1st Release added to tags.
parent
294c2a9c
Changes
12
Expand all
Hide whitespace changes
Inline
Side-by-side
jmess/
COPYING.GPL.txt
→
COPYING.GPL.txt
View file @
31da3159
File moved
jmess/
INSTALL.txt
→
INSTALL.txt
View file @
31da3159
File moved
jmess/
TODO.txt
→
TODO.txt
View file @
31da3159
File moved
doc/anyoption/AnyOptionDemo.txt
deleted
100644 → 0
View file @
294c2a9c
/*
* Here is a sample of how to use AnyOption to
* parse comand line argumnets and an ptions file
*
* Create sample.txt as follows
*
* # sample options file
* # this is a comment
* zip
* size : 42
* title : This is a test title.
*
* Run the sample with any combination of the options
*
* a.out -c --zip -s 20 --name foo.jpg argtest1 argtest2
*/
#include "anyoption.h"
void example( int argc, char* argv[] );
int
main( int argc, char* argv[] )
{
example( argc, argv );
return 0 ;
}
void
example( int argc, char* argv[] )
{
/* 1. CREATE AN OBJECT */
AnyOption *opt = new AnyOption();
/* 2. SET PREFERENCES */
//opt->noPOSIX(); /* do not check for POSIX style character options */
//opt->setVerbose(); /* print warnings about unknown options */
//opt->autoUsagePrint(true); /* print usage for bad options */
/* 3. SET THE USAGE/HELP */
opt->addUsage( "" );
opt->addUsage( "Usage: " );
opt->addUsage( "" );
opt->addUsage( " -h --help Prints this help " );
opt->addUsage( " -s --size 42 Image Size " );
opt->addUsage( " -z --zip Compress Image " );
opt->addUsage( " -c convert Image " );
opt->addUsage( " --name image.jpg Image Name " );
opt->addUsage( "" );
/* 4. SET THE OPTION STRINGS/CHARACTERS */
/* by default all options will be checked on the command line and from option/resource file */
opt->setFlag( "help", 'h' ); /* a flag (takes no argument), supporting long and short form */
opt->setOption( "size", 's' ); /* an option (takes an argument), supporting long and short form */
opt->setOption( "name" ); /* an option (takes an argument), supporting only long form */
opt->setFlag( 'c' ); /* a flag (takes no argument), supporting only short form */
/* for options that will be checked only on the command and line not in option/resource file */
opt->setCommandFlag( "zip" , 'z'); /* a flag (takes no argument), supporting long and short form */
/* for options that will be checked only from the option/resource file */
opt->setFileOption( "title" ); /* an option (takes an argument), supporting only long form */
/* 5. PROCESS THE COMMANDLINE AND RESOURCE FILE */
/* read options from a option/resource file with ':' separated opttions or flags, one per line */
opt->processFile( "/home/user/.options" );
/* go through the command line and get the options */
opt->processCommandArgs( argc, argv );
if( ! opt->hasOptions()) { /* print usage if no options */
opt->printUsage();
delete opt;
return;
}
/* 6. GET THE VALUES */
if( opt->getFlag( "help" ) || opt->getFlag( 'h' ) )
opt->printUsage();
if( opt->getValue( 's' ) != NULL || opt->getValue( "size" ) != NULL )
cout << "size = " << opt->getValue( 's' ) << endl ;
if( opt->getValue( "name" ) != NULL )
cout << "name = " << opt->getValue( "name" ) << endl ;
if( opt->getValue( "title" ) != NULL )
cout << "title = " << opt->getValue( "title" ) << endl ;
if( opt->getFlag( 'c' ) )
cout << "c = flag set " << endl ;
if( opt->getFlag( 'z' ) || opt->getFlag( "zip" ) )
cout << "zip = flag set " << endl ;
cout << endl ;
/* 7. GET THE ACTUAL ARGUMENTS AFTER THE OPTIONS */
for( int i = 0 ; i < opt->getArgc() ; i++ ){
cout << "arg = " << opt->getArgv( i ) << endl ;
}
/* 8. DONE */
delete opt;
}
jmess_doxygen
deleted
100644 → 0
View file @
294c2a9c
This diff is collapsed.
Click to expand it.
m_doxygen
deleted
100755 → 0
View file @
294c2a9c
#!/bin/bash
rm
-r
/user/j/jcaceres/Library/Web/jmess/
*
doxygen jmess_doxygen
chmod
-R
o+rx /user/j/jcaceres/Library/Web/jmess
jmess/
src/JMess.cpp
→
src/JMess.cpp
View file @
31da3159
File moved
jmess/
src/JMess.h
→
src/JMess.h
View file @
31da3159
File moved
jmess/
src/anyoption.cpp
→
src/anyoption.cpp
View file @
31da3159
File moved
jmess/
src/anyoption.h
→
src/anyoption.h
View file @
31da3159
File moved
jmess/
src/jmess_main.cpp
→
src/jmess_main.cpp
View file @
31da3159
File moved
jmess/
src/m
→
src/m
View file @
31da3159
File moved
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment