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

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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2