Subversion Repositories gelsvn

Rev

Rev 448 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 448 Rev 595
Line -... Line 1...
-
 
1
/**
-
 
2
 * @file ArgExtracter.h
-
 
3
 * @brief Simple functionality for getting command line parameters.
-
 
4
 */
-
 
5
/* ----------------------------------------------------------------------- *
-
 
6
 * This file is part of GEL, http://www.imm.dtu.dk/GEL
-
 
7
 * Copyright (C) the authors and DTU Informatics
-
 
8
 * For license and list of authors, see ../../doc/intro.pdf
-
 
9
 * ----------------------------------------------------------------------- */
-
 
10
 
1
#ifndef __UTIL_ARG_EXTRACTER__
11
#ifndef __UTIL_ARG_EXTRACTER__
2
#define __UTIL_ARG_EXTRACTER__
12
#define __UTIL_ARG_EXTRACTER__
3
#include <vector>
13
#include <vector>
4
#include <algorithm>
14
#include <algorithm>
5
#include <cstdlib>
15
#include <cstdlib>
Line 37... Line 47...
37
				std::for_each(s.begin(), s.end(), UpCase());
47
        std::for_each(s.begin(), s.end(), UpCase());
38
		}
48
    }
39
 
49
 
40
 
50
 
41
 
51
 
42
 
-
 
-
 
52
    /// Extract arguments from command line parameters.
43
		class ArgExtracter
53
    class ArgExtracter
44
		{	
54
    {	
45
				std::list<std::string> avec;
55
        std::list<std::string> avec;
46
				typedef std::list<std::string>::iterator LSI;
56
        typedef std::list<std::string>::iterator LSI;
47
 
57
 
Line 83... Line 93...
83
										return true;
93
                return true;
84
								}
94
            }
85
								return false;
95
            return false;
86
						}
96
        }
87
 
97
 
88
				int no_remaining_args() const
98
        size_t no_remaining_args() const
89
						{
99
        {
90
								return avec.size();
100
            return avec.size();
91
						}
101
        }
92
 
102
 
93
				const std::string& get_last_arg() const
103
        const std::string& get_last_arg() const