xcmdline.h 1.63 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*! \file xcmdline.h
 * \brief parse extra commandline values (prototypes)
 * 
 * ----------------------------------------------------------------------------
 * 
 * $Id: xcmdline.h,v 1.1 2005-06-28 10:51:13 tforb Exp $
 * \author Thomas Forbriger
 * \date 28/06/2005
 * 
 * parse extra commandline values (prototypes)
 * 
 * Copyright (c) 2005 by Thomas Forbriger (BFO Schiltach) 
 * 
 * REVISIONS and CHANGES 
 *  - 28/06/2005   V1.0   Thomas Forbriger
 * 
 * ============================================================================
 */

// include guard
#ifndef TF_XCMDLINE_H_VERSION

#define TF_XCMDLINE_H_VERSION \
  "TF_XCMDLINE_H   V1.0   "
#define TF_XCMDLINE_H_CVSID \
  "$Id: xcmdline.h,v 1.1 2005-06-28 10:51:13 tforb Exp $"

#include <tfxx/commandline.h>
#include <string>
#include <list>

namespace tfxx {
  namespace cmdline {

    struct FileOption {
      std::string key;
      std::string value;
    }; // struct FileOption

    typedef std::list<FileOption> Toptionlist;

    struct Filename {
      std::string name;
      Toptionlist options;
    }; // struct Filename

    /*!
     *
     * in case you want pass options in the form
     *   
     *   filename f:option1 dl:option2 k:option3
     *
     * you should generate keys of the form
     * 
     *   static const char* keys[]={"f", "dl", "k", 0};
     */
    typedef std::list<Filename> Tparsed;
    Tparsed parse_cmdline(tfxx::cmdline::Commandline& c,
                          const char** keys,
                          const bool& debug=false);
    
  } // namespace cmdline
} // namespace tfxx

#endif // TF_XCMDLINE_H_VERSION (includeguard)

/* ----- END OF xcmdline.h ----- */