(file) Return to mofCompilerOptions.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Compiler

  1 karl  1.25 //%2006////////////////////////////////////////////////////////////////////////
  2 mike  1.9  //
  3 karl  1.20 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
  4            // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
  5            // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
  6 karl  1.19 // IBM Corp.; EMC Corporation, The Open Group.
  7 karl  1.20 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
  8            // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
  9 karl  1.21 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 10            // EMC Corporation; VERITAS Software Corporation; The Open Group.
 11 karl  1.25 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 12            // EMC Corporation; Symantec Corporation; The Open Group.
 13 mike  1.9  //
 14            // Permission is hereby granted, free of charge, to any person obtaining a copy
 15 kumpf 1.13 // of this software and associated documentation files (the "Software"), to
 16            // deal in the Software without restriction, including without limitation the
 17            // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 18 mike  1.9  // sell copies of the Software, and to permit persons to whom the Software is
 19            // furnished to do so, subject to the following conditions:
 20 karl  1.27 //
 21 kumpf 1.13 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 22 mike  1.9  // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 23            // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 24 kumpf 1.13 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 25            // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 26            // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 27 mike  1.9  // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 28            // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 29            //
 30            //==============================================================================
 31            //
 32            //%/////////////////////////////////////////////////////////////////////////////
 33            
 34            
 35            //
 36 bob   1.10 // Header for a class to hold options available to users of the
 37            // cimmof embeddable compiler.
 38 mike  1.9  //
 39            //
 40            //
 41            // Defines the mofCompilerOptions class, which contains all you
 42            // want to know about the command line that invoked the compiler,
 43            // including
 44            //             The include (-I) paths
 45            //             The repository to talk to (-R)
 46            //             Other compiler options
 47            //                 syntax check only (-E)
 48            //                 suppress warnings (-w)
 49            //             The files to be compiled.
 50            //
 51 karl  1.12 // ATTN: BB P3  Mar 2001 This needs to be reworked so that the same options
 52            // offered by the Microsoft compiler are supported.  They allow modes for
 53 mike  1.9  //      -- Marking as an error an attempt to create an existing object
 54            //      -- Marking as an error an attempt to create an existing object
 55            //         with different elements (i.e. overwriting)
 56            
 57            #ifndef _MOFCOMPILEROPTIONS_H_
 58            #define _MOFCOMPILEROPTIONS_H_
 59            
 60            #include <Pegasus/Common/String.h>
 61 kumpf 1.15 #include <Pegasus/Common/ArrayInternal.h>
 62 bob   1.10 #include <Pegasus/Compiler/compilerCommonDefs.h>
 63 kumpf 1.14 #include <Pegasus/Compiler/Linkage.h>
 64 mike  1.9  #include <iostream>
 65            
 66            PEGASUS_USING_PEGASUS;
 67            
 68            class PEGASUS_COMPILER_LINKAGE mofCompilerOptions {
 69             private:
 70              Array<String> _include_paths;
 71              Array<String> _filespecs;
 72              String       _repository;
 73 jim.wunderlich 1.22   String        _repository_name;
 74                       String        _repository_mode;
 75 mike           1.9    String                _namespacePath;
 76                       Boolean         _syntax_only;
 77 bob            1.11   Boolean         _is_local;
 78 mike           1.9    Boolean         _suppress_warnings;
 79                       Boolean         _suppress_all_messages;
 80 bob            1.10   Boolean         _emit_xml;
 81                       compilerCommonDefs::operationType _ot;
 82 mike           1.9    Boolean         _trace;
 83 karl           1.27   Boolean     _update_class;
 84                       Boolean     _allow_experimental;
 85                       Boolean     _allow_version;
 86 ouyang.jian    1.28 #ifdef PEGASUS_OS_PASE
 87                       Boolean         _quiet;
 88                     #endif
 89 mike           1.23   Boolean         _no_usage_warning;
 90 mike           1.30   Boolean         _mrr;
 91                       Boolean         _discard;
 92 mike           1.23 
 93 mike           1.9    PEGASUS_STD(ostream)      *_traceos;
 94                       PEGASUS_STD(ostream)      *_erroros;
 95                       PEGASUS_STD(ostream)      *_warningos;
 96                      public:
 97 karl           1.27   mofCompilerOptions() : _repository(String::EMPTY),
 98 jim.wunderlich 1.22     _repository_name(String::EMPTY),
 99                         _repository_mode(String::EMPTY),
100 mike           1.9      _namespacePath(""),
101                         _syntax_only(false),
102 bob            1.11     _is_local(false),
103 mike           1.9      _suppress_warnings(false),
104                         _suppress_all_messages(false),
105 bob            1.10     _emit_xml(false),
106                         _ot(compilerCommonDefs::USE_REPOSITORY),
107 mike           1.9      _trace(false),
108 mike           1.24     _no_usage_warning(false),
109 mike           1.30     _mrr(false),
110                         _discard(false),
111 mike           1.9      _traceos(0),
112                         _erroros(0),
113                         _warningos(0)
114                         {;}
115                     
116                       ~mofCompilerOptions() {;}
117                     
118                       void add_include_path(const String& path) { _include_paths.append(path); }
119                       const Array<String> &get_include_paths() const { return _include_paths; }
120                       void add_filespecs(const String &spec) { _filespecs.append(spec); }
121                       const Array<String>& get_include_path_list() const {return _include_paths; }
122                       const Array<String>& get_filespec_list() const { return _filespecs; }
123 jim.wunderlich 1.22   void  set_repository(const String &repository) { \
124 mike           1.9      _repository = repository; }
125 jim.wunderlich 1.22   const String &get_repository() const { return _repository; }
126                       void  set_repository_name(const String &repository_name) { \
127                         _repository_name = repository_name; }
128                       const String &get_repository_name() const { return _repository_name; }
129                       void  set_repository_mode(const String &repository_mode) { \
130                         _repository_mode = repository_mode; }
131                       const String &get_repository_mode() const { return _repository_mode; }
132 mike           1.9    void set_syntax_only() { _syntax_only = true; }
133                       void reset_syntax_only() { _syntax_only = false; }
134                       Boolean syntax_only() const { return _syntax_only; }
135 bob            1.11   void set_is_local() { _is_local = true; }
136                       void reset_is_local() { _is_local = false; }
137                       Boolean is_local() const { return _is_local; }
138 mike           1.9    void set_suppress_warnings() { _suppress_warnings = true; }
139                       void reset_suppress_warnings() { _suppress_warnings = false; }
140                       Boolean suppress_warnings() const { return _suppress_warnings; }
141                       void set_suppress_all_messages() { _suppress_all_messages = true; }
142                       void reset_suppress_all_messages() { _suppress_all_messages = false; }
143                       Boolean suppress_all_messages() const { return _suppress_all_messages; }
144                       void set_trace() { _trace = true; }
145                       void reset_trace() { _trace = false; }
146                       Boolean trace() const { return _trace; }
147 gerarda        1.18   void set_update_class() { _update_class = true; }
148                       void reset_update_class() { _update_class = false; }
149                       Boolean update_class() const { return _update_class; }
150                       void set_allow_experimental() { _allow_experimental = true; }
151                       void reset_allow_experimental() { _allow_experimental = false; }
152                       Boolean allow_experimental() const { return _allow_experimental; }
153                       void set_allow_version() { _allow_version = true; }
154                       void reset_allow_version() { _allow_version = false; }
155                       Boolean allow_version() const { return _allow_version; }
156 ouyang.jian    1.28 #ifdef PEGASUS_OS_PASE
157                       void set_quiet() { _quiet = true; }
158                       void reset_quiet() { _quiet = false; }
159                       Boolean quiet() const { return _quiet; }
160                     #endif
161 bob            1.10   void set_operationType(compilerCommonDefs::operationType ot) { _ot = ot; }
162                       void reset_operationType() { _ot = compilerCommonDefs::USE_REPOSITORY; }
163                       compilerCommonDefs::operationType operationType() const { return _ot; }
164                       void set_xmloutput() { _emit_xml = true; }
165                       void reset_xmloutput() { _emit_xml = false; }
166                       Boolean xml_output() const { return _emit_xml; }
167 mike           1.9    void set_traceos(PEGASUS_STD(ostream) &os) { _traceos = &os; }
168                       void reset_traceos() { _traceos = 0; }
169 sushma.fernandes 1.29   PEGASUS_STD(ostream) &traceos() const
170                         { 
171                             return _traceos ? (PEGASUS_STD(ostream)&)*_traceos : 
172                                 (PEGASUS_STD(ostream)&)PEGASUS_STD(cout); 
173                         }
174                         void set_erroros(PEGASUS_STD(ostream) &os) { _erroros = &os; }
175 mike             1.9    void reset_erroros() { _erroros = 0; }
176 sushma.fernandes 1.29   PEGASUS_STD(ostream) &erroros() const
177                         { 
178                             return _erroros ? (PEGASUS_STD(ostream)&)*_erroros : 
179                                 (PEGASUS_STD(ostream)&)PEGASUS_STD(cerr); 
180                         }
181                         void set_warningos(PEGASUS_STD(ostream &os)) { _warningos = &os; }
182 mike             1.9    void reset_warningos() { _warningos = 0; }
183 sushma.fernandes 1.29   PEGASUS_STD(ostream) &warningos() const
184                         {
185                             return _warningos ? (PEGASUS_STD(ostream)&)*_warningos :
186                                 (PEGASUS_STD(ostream)&)PEGASUS_STD(cerr);
187                         }
188 mike             1.9    void set_namespacePath(const String &path) { _namespacePath = path; }
189                         const String &get_namespacePath() const  { return _namespacePath; }
190 mike             1.23   void set_no_usage_warning() { _no_usage_warning = true; }
191                         Boolean get_no_usage_warning() const { return _no_usage_warning; }
192 mike             1.30   void set_mrr() { _mrr = true; }
193                         void reset_mrr() { _mrr = false; }
194                         Boolean mrr() const { return _mrr; }
195                         void set_discard() { _discard = true; }
196                         void reset_discard() { _discard = false; }
197                         Boolean discard() const { return _discard; }
198 mike             1.9  };
199                       
200                       #endif

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2