blob: 0caa9ef19694404fffd7994857330693cb2d8283 (
plain)
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
|
/***************************************************************************
* Copyright (C) 2003 by Antonio Fasolato *
* [email protected] *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#ifndef OPTIONS_H
#define OPTIONS_H
#include <map>
using namespace std;
#include <tqstring.h>
//! Class that contains all the options for a document.
/*!
* \author Antonio Fasolato <[email protected]>
* \version 1.0
*
* Class that contains all the options for a document. These options regards the most disparate values: output formats, algorithm to use with potrace...<BR>
* Mainly this class contains options relevant to potrace.
*/
class Options{
public:
//! Default constructor
Options();
//! Sets a pair (key,value) in this Options object.
/*!
* \param key The name of the option. Later on it will be used to read its value
* \param value The value associated with the key
*
* Sets a pair (key,value) in this Options object. If name is not in this object, it is added.
*
* \sa operator[]()
*/
void setValue(TQString key, TQString value);
//! Checks if the object contains no keys
/*!
* \returns \b true if the object is empty, \b false otherwise
*/
bool isEmpty();
//! Clears all the options in the object
void clear();
//! Retrives an option value from the key associated whith it
/*!
* \param key the key of the option to retrive
* \returns The value associated with the key
* \sa setValue()
*/
TQString operator[](TQString key);
//! Sets all the options to their default value.
void defaultOptions();
//! Prints the list of options
void debug();
private:
map<TQString,TQString> options; /*!< The map containing the options */
};
#endif
|