- Make inserting filenames into vector simpler

git-svn-id: svn://svn.gna.org/svn/sgpemv2/trunk@281 3ecf2c5c-341e-0410-92b4-d18e462d057c
This commit is contained in:
tchernobog 2006-02-01 14:07:09 +00:00
parent 4333591e8f
commit fc8d5cb258
2 changed files with 25 additions and 17 deletions

View File

@ -1,3 +1,27 @@
2006-01-31 22:49 tchernobog
* trunk/configure.ac: - Add check to get sigc++ cflags and ldflags
separately, if needed
2006-01-31 21:11 tchernobog
* trunk/m4/ac_python_devel.m4: - Typo : bail out for python <= 2.1.0
instead of 2.5.0
2006-01-31 20:18 tchernobog
* trunk/m4/ac_python_devel.m4: - Fix typo
2006-01-31 19:06 tchernobog
* trunk/ChangeLog, trunk/m4/ac_python_devel.m4: - Update
ac_python_devel to check and complain about Python < 2.1.0.
2006-01-31 11:59 tchernobog
* trunk/src/backend/schedulable.hh, trunk/src/parseopts.hh: - Fix
api docs : aesthetics
2006-01-29 17:33 tchernobog 2006-01-29 17:33 tchernobog
* trunk/m4/ac_python_devel.m4: - Fix macro documentation header * trunk/m4/ac_python_devel.m4: - Fix macro documentation header

View File

@ -25,26 +25,10 @@
#include "parseopts.hh" #include "parseopts.hh"
#include "startgui.hh" #include "startgui.hh"
#include <algorithm>
#include <functional>
#include <iostream> #include <iostream>
#include <iterator>
#include <string> #include <string>
#include <vector> #include <vector>
// Functor to be used by for_each()
struct create_fnames_vect : public std::unary_function<const char*, void>
{
typedef std::vector<std::string>& vect_type;
public:
create_fnames_vect(vect_type v) : _v(v) {}
void operator()(const char* str) {_v.push_back(str);}
private:
vect_type _v;
};
int int
main(int argc, char* argv[]) main(int argc, char* argv[])
{ {
@ -62,7 +46,7 @@ main(int argc, char* argv[])
int a_count = argc; int a_count = argc;
char** a_ptr = argv; char** a_ptr = argv;
parse_options(a_count, a_ptr); parse_options(a_count, a_ptr);
for_each(a_ptr, a_ptr+a_count, create_fnames_vect(filenames)); filenames.insert(filenames.begin(), a_ptr, a_ptr+a_count);
} }
start_gui(argc, argv); start_gui(argc, argv);