[go: up one dir, main page]

Menu

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

Download this file

104 lines (85 with data), 4.1 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
/****************************************************************************
|
| 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_OMCCLPCOMMON_H_INCLUDE_GUARD_
#define OMC_OMCCLPCOMMON_H_INCLUDE_GUARD_
#include <iostream>
#include <stdarg.h>
#include "omcclpconf.h"
#include <openwbem/OW_config.h>
#include <openwbem/OW_CIMClient.hpp>
#include <openwbem/OW_CIMException.hpp>
#include <openwbem/OW_CIMObjectPath.hpp>
#include <openwbem/OW_String.hpp>
#include <openwbem/OW_Array.hpp>
#include <openwbem/OW_WBEMFlags.hpp>
using namespace OW_NAMESPACE;
using namespace OpenWBEM;
using namespace WBEMFlags;
using std::cerr;
using std::cin;
using std::cout;
//using std::endl;
extern void* addrgram__set_scan_string( const char *yy_str );
extern int addrgram_doparse (void *omcclp);
#define DISPLAY_ARRAY1(disparray,meth) \
for (int aaa=0; aaa<disparray.size(); aaa++) { \
cout << disparray[aaa].meth() << CLPENDL; }
#define STRIP_QUOTES(s) \
if (s.startsWith('"') && s.endsWith('"')) { \
s = s.substring(1); \
s = s.substring(0,s.length()-1); }
#define CLPENDL "\r\n"
#define PROMPT "-> "
#define CLPPROMPT "CLP"PROMPT
namespace OMCCLP {
class OMCCLPProgram;
String safeBack(StringArray sa);
String safeFront(StringArray sa);
CIMObjectPath safeFront(CIMObjectPathArray copa);
Int32 countOccurrance(char *str, char *pattern);
String stripUFiS(String ufit);
String getCIMClassName (OMCCLPProgram *clpSession, const String& ufit, Int32 *ufis=0);
String getUFcTFromCIMClassName (OMCCLPProgram* clpSession, const String& className);
CIMObjectPath getCIMObjectPathFromUFiT (OMCCLPProgram* clpSession, const String& ufit);
Int32 getUFiSFromObjectPath (const CIMObjectPath& cop);
String getCIMAssocClassName (OMCCLPProgram* clpSession, String ufct1, String ufct2);
String getCIMAssocClassName (OMCCLPProgram* clpSession, CIMObjectPath cop, String UFcT);
String getCIMAssocClassName (OMCCLPProgram* clpSession, String targetAssoc);
CIMObjectPathArray getCIMObjectPathsForTargetAssociation(OMCCLPProgram* clpSession, CIMObjectPath cop, String targetAssociation, String targetPathSecondary);
CIMObjectPathArray getCIMObjectPathsForEmbededAssociation(OMCCLPProgram* clpSession, CIMObjectPath cop, String targetAssociation, String targetPathSecondary);
CIMObjectPathArray getCIMObjectPathsFromUFiP (OMCCLPProgram* clpSession, const String& ufip);
CIMObjectPath getCIMObjectPathFromUFiP (OMCCLPProgram* clpSession, const String& ufip);
String getUFiPFromCIMObjectPath (OMCCLPProgram* clpSession, const CIMObjectPath& cop, String UFcT="", String UFiP="");
CIMObjectPath getAdminDomainCIMObjectPath (OMCCLPProgram* clpSession);
String getCIMClassFilter (OMCCLPProgram* clpSession, const String& ufit);
bool checkCIMClassFilter (OMCCLPProgram* clpSession, const CIMObjectPath& cop, const String& filter);
CIMInstance getCIMInstanceFromUFiP (OMCCLPProgram* clpSession, const String& ufip);
String getUFcTFromCIMObjectPath (OMCCLPProgram* clpSession, const CIMObjectPath& cop);
StringArray getUFcTsFromCIMObjectPath (OMCCLPProgram* clpSession, const CIMObjectPath& cop);
bool classIsDerivedFrom(OMCCLPProgram* clpSession, const String& derived, const String& super);
OW_DECLARE_EXCEPTION(OMCCLP);
}
using namespace OMCCLP;
#endif