/****************************************************************************
|
| 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