[go: up one dir, main page]

Menu

[r505]: / clp / trunk / src / omcclpoption.h  Maximize  Restore  History

Download this file

123 lines (103 with data), 3.4 kB

  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
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
/****************************************************************************
|
| Copyright (c) 2006 Novell, Inc.
| All Rights Reserved.
|
| This program is free software; you can redistribute it and/or
| modify it under the terms of version 2 of the GNU General Public License as
| published by the Free Software Foundation.
|
| This program is distributed in the hope that it will be useful,
| but WITHOUT ANY WARRANTY; without even the implied warranty of
| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
| GNU General Public License for more details.
|
| You should have received a copy of the GNU General Public License
| along with this program; if not, contact Novell, Inc.
|
| To contact Novell about this file by physical or electronic mail,
| you may find current contact information at www.novell.com
|
|***************************************************************************
/**
@author Brad Nicholes
*/
#ifndef OMC_OMCCLPOPTION_H_INCLUDE_GUARD_
#define OMC_OMCCLPOPTION_H_INCLUDE_GUARD_
#include "omcclpcommon.h"
#include <openwbem/OW_String.hpp>
#include <openwbem/OW_Reference.hpp>
#include <openwbem/OW_Array.hpp>
#include <openwbem/OW_CIMValue.hpp>
namespace OMCCLP {
enum CLP_OPTIONS {
E_OPT_NONE,
E_OPT_ALL,
E_OPT_DESTINATION,
E_OPT_DISPLAY,
E_OPT_EXAMINE,
E_OPT_FORCE,
E_OPT_HELP,
E_OPT_KEEP,
E_OPT_LEVEL,
E_OPT_OUTPUT,
E_OPT_SOURCE,
E_OPT_VERSION,
E_OPT_WAIT,
};
enum CLP_SUBOPTIONS {
E_SUBOPT_NONE,
E_SUBOPT_FORMAT,
E_SUBOPT_VERBOSITY,
E_SUBOPT_LANGUAGE,
E_SUBOPT_BEGIN,
E_SUBOPT_END,
E_SUBOPT_ORDER,
E_SUBOPT_NUMBER,
E_SUBOPT_COUNT,
E_SUBOPT_ALL,
E_SUBOPT_VERBS,
E_SUBOPT_ASSOCIATIONS,
E_SUBOPT_TARGETS,
E_SUBOPT_PROPERTIES,
};
#define OUTPUT_ORDER_DEFAULT 0
#define OUTPUT_ORDER_REVERSE 1
/* These should match the OutputFormat in CIM_CLPSettingData */
#define OUTPUT_DISPLAY_TEXT 2
#define OUTPUT_DISPLAY_KEYWORD 4
#define OUTPUT_DISPLAY_CLPXML 5
#define OUTPUT_VERBOSITY_ERROR 2
#define OUTPUT_VERBOSITY_TERSE 3
#define OUTPUT_VERBOSITY_VERBOSE 4
class OMCCLPCommand;
class OMCCLPOption;
typedef Reference<OMCCLPOption> OMCCLPOptionRef;
typedef Array<OMCCLPOptionRef> OMCCLPOptionsArray;
class OMCCLPOption {
public:
OMCCLPOption(CLP_OPTIONS option_type=E_OPT_NONE, CLP_SUBOPTIONS sub_option_type=E_SUBOPT_NONE)
: m_option_type(option_type)
, m_option_subtype(sub_option_type)
, m_value()
, m_option_arg_range_lower()
, m_option_arg_range_upper() {}
virtual ~OMCCLPOption() {}
CLP_OPTIONS getOptionType() {return m_option_type;}
CLP_SUBOPTIONS getOptionSubtype() {return m_option_subtype;}
void setOptionType(CLP_OPTIONS optionType) {m_option_type = optionType;}
void setSubOptionType (CLP_SUBOPTIONS suboptionType) {m_option_subtype = suboptionType;}
StringArray getOptionValue() {return m_value;}
void setOptionValue (String value){m_value.push_back(value);}
bool hasOptionValue () {return m_value.size() != 0;}
void getOptionValue (Int32 *argLower, Int32 *argUpper) {*argLower = m_option_arg_range_lower;
*argUpper = m_option_arg_range_upper;}
private:
CLP_OPTIONS m_option_type;
CLP_SUBOPTIONS m_option_subtype;
StringArray m_value;
Int32 m_option_arg_range_lower;
Int32 m_option_arg_range_upper;
};
}
#endif