Add support for multiple configurations in playuverTools

This commit is contained in:
jfmcarreira committed 2016-04-07 00:08:11 +01:00
1 parent eff93de754
commit d151b11c8c
6 files changed
+113 -75

No files matched your search

-5
View File
@@ -66,11 +66,6 @@ Bool PlaYUVerCmdParser::parse()
// m_cParserOptions.setDefaults();
m_aUnhandledArgs = m_cParserOptions.scanArgv( m_iArgc, ( const Char** )m_ppArgv );
// for( std::list<const Char*>::const_iterator it = argv_unhandled.begin(); it != argv_unhandled.end(); it++ )
// {
// fprintf( stderr, "Unhandled argument ignored: `%s'\n", *it );
// }
if( checkListingOpts() )
{
return false;
+6 -1
View File
@@ -1,7 +1,7 @@
/* The copyright in this software is being made available under the BSD
* License, included below. This software may be subject to other third party
* and contributor rights, including patent rights, and no such rights are
* granted under this license.
* granted under this license.
*
* Copyright (c) 2010-2014, ITU/ISO/IEC
* All rights reserved.
@@ -94,6 +94,11 @@ OptionBase* Options::getOption( const std::string& optName )
return NULL;
}
Bool Options::hasOpt( const std::string& optName )
{
return getOption( optName )->count() > 0 ? true : false;
}
void Options::addOption( OptionBase *opt )
{
Option* names = new Option();
+41 -5
View File
@@ -1,7 +1,7 @@
/* The copyright in this software is being made available under the BSD
* License, included below. This software may be subject to other third party
* and contributor rights, including patent rights, and no such rights are
* granted under this license.
* granted under this license.
*
* Copyright (c) 2010-2014, ITU/ISO/IEC
* All rights reserved.
@@ -171,8 +171,43 @@ inline void StandardOpt<T>::parse( const std::string& arg )
arg_count++;
}
/* string parsing is specialized -- copy the whole string, not just the
* first word */
template<>
inline void StandardOpt< std::vector<UInt> >::parse( const std::string& arg )
{
UInt aux_opt_storage;
std::istringstream arg_ss( arg, std::istringstream::in );
arg_ss.exceptions( std::ios::failbit );
try
{
arg_ss >> aux_opt_storage;
opt_storage.push_back( aux_opt_storage );
}
catch( ... )
{
throw ParseFailure( opt_string, arg );
}
arg_count++;
}
template<>
inline void StandardOpt< std::vector<Int> >::parse( const std::string& arg )
{
Int aux_opt_storage;
std::istringstream arg_ss( arg, std::istringstream::in );
arg_ss.exceptions( std::ios::failbit );
try
{
arg_ss >> aux_opt_storage;
opt_storage.push_back( aux_opt_storage );
}
catch( ... )
{
throw ParseFailure( opt_string, arg );
}
arg_count++;
}
/* string parsing is specialized */
template<>
inline void StandardOpt<std::string>::parse( const std::string& arg )
{
@@ -180,8 +215,7 @@ inline void StandardOpt<std::string>::parse( const std::string& arg )
arg_count++;
}
/* string parsing is specialized -- copy the whole string, not just the
* first word */
/* string vector parsing is specialized */
template<>
inline void StandardOpt<std::vector<std::string> >::parse( const std::string& arg )
{
@@ -259,6 +293,8 @@ public:
return opt_list;
}
Bool hasOpt( const std::string& optName );
void addOption( OptionBase *opt );
private: