Repo initialisation

This commit is contained in:
Pierre-Olivier Mercier 2012-07-09 07:29:17 +02:00
commit 6a89d1f5df
14 changed files with 586 additions and 0 deletions

7
src/Makefile.am Normal file
View file

@ -0,0 +1,7 @@
MAINTAINERCLEANFILES = Makefile.in
CLEANFILES = *~ \#* *.swp
SUBDIRS = \
filterSample/ \
encoder/

9
src/encoder/Makefile.am Normal file
View file

@ -0,0 +1,9 @@
noinst_LIBRARIES = ../../lib/libencoder.a
MAINTAINERCLEANFILES = Makefile.in
AM_CXXFLAGS = \
$(BOOST_CPPFLAGS) \
$(DEBUG_CXXFLAGS)
______lib_libencoder_a_SOURCES =

View file

@ -0,0 +1,9 @@
noinst_LIBRARIES = ../../lib/libfilterSample.a
MAINTAINERCLEANFILES = Makefile.in
AM_CXXFLAGS = \
$(BOOST_CPPFLAGS) \
$(DEBUG_CXXFLAGS)
______lib_libfilterSample_a_SOURCES =

58
src/main.cc Normal file
View file

@ -0,0 +1,58 @@
#include <iostream>
#include <boost/program_options.hpp>
int
main (int argc, char** argv)
{
namespace po = boost::program_options;
// Register all possible options
po::options_description desc("Allowed options");
desc.add_options()
("help,h", "produce help message")
("filter,f", po::value<std::vector<std::string> > (), "apply a filter")
("input-file,i", po::value<std::vector<std::string> > (), "file to treat")
;
// Handle ./prpa file.avi instead of ./prpa --input-file=file.avi
po::positional_options_description p;
p.add("input-file", -1);
// Read command line
po::variables_map vm;
try
{
po::store(po::command_line_parser(argc, argv).
options(desc).positional(p).run(), vm);
}
catch (po::invalid_command_line_syntax e)
{
std::cerr << argv[0] << ": " << e.what() << std::endl;
return 1;
}
po::notify(vm);
// Handle -h and --help
if (argc <= 1 || vm.count("help"))
{
std::cout << desc << "\n";
return 1;
}
// GO!
std::cout << "Given filters: ";
if (vm.count("filter"))
std::cout << vm["filter"].as<std::vector<std::string> > ().size()
<< std::endl;
else
std::cout << 0 << std::endl;
std::cout << "Given files: ";
if (vm.count("input-file"))
std::cout << vm["input-file"].as<std::vector<std::string> > ().size()
<< std::endl;
else
std::cout << 0 << std::endl;
return 0;
}