(file) Return to ConfigExceptions.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Config

  1 martin 1.12 //%LICENSE////////////////////////////////////////////////////////////////
  2 martin 1.13 //
  3 martin 1.12 // 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.13 //
 10 martin 1.12 // 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.13 //
 17 martin 1.12 // The above copyright notice and this permission notice shall be included
 18             // in all copies or substantial portions of the Software.
 19 martin 1.13 //
 20 martin 1.12 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 21 martin 1.13 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 22 martin 1.12 // 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.13 //
 28 martin 1.12 //////////////////////////////////////////////////////////////////////////
 29 mike   1.2  //
 30             //%/////////////////////////////////////////////////////////////////////////////
 31             
 32 dl.meetei 1.13.10.1 #include <Pegasus/Common/StringConversion.h>
 33 mike      1.2       #include "ConfigExceptions.h"
 34                     
 35                     PEGASUS_NAMESPACE_BEGIN
 36                     
 37 dl.meetei 1.13.10.1 /**
 38                         UnrecognizedCommandLineOption Exception class
 39                     */
 40                     UnrecognizedCommandLineOption::UnrecognizedCommandLineOption()
 41                         :Exception(
 42                             MessageLoaderParms(
 43                                 "Config.ConfigExceptions.UNRECOGNIZED_CMDLINE_OPTION",
 44                                 "Unrecognized command line option. "))
 45                     {
 46                     }
 47                     
 48                     
 49                     /**
 50                         InvalidPropertyValue Exception class
 51                     */
 52                     InvalidPropertyValue::InvalidPropertyValue(
 53                         const String& name,
 54                         const String& value)
 55                             :Exception(
 56                                 MessageLoaderParms(
 57                                     "Config.ConfigExceptions.INVALID_PROPERTY_VALUE",
 58 dl.meetei 1.13.10.1                 "Invalid property value: $0=$1",
 59                                     name,
 60                                     value))
 61                     {
 62                     }
 63                     
 64                     InvalidPropertyValue::InvalidPropertyValue(const MessageLoaderParms& theMessage)
 65                              :Exception(theMessage)
 66                     {
 67                     }
 68                     
 69                     
 70                     /**
 71                         InvalidDirectoryPropertyValue Exception class
 72                     */
 73                     InvalidDirectoryPropertyValue::InvalidDirectoryPropertyValue(
 74                         const String& name,
 75                         const String& value)
 76                             :InvalidPropertyValue(
 77                                 MessageLoaderParms(
 78                                     "Config.ConfigExceptions.INVALID_DIRECTORY_PROPERTY_VALUE",
 79 dl.meetei 1.13.10.1                 "For property $0 specified value $1 is not a directory or "
 80                                         "the directory is not writeable.",
 81                                     name,
 82                                     value))
 83                     {
 84                     }
 85                     
 86                     ConfigFileSyntaxError::ConfigFileSyntaxError(const String& file, Uint32 line)
 87                         :Exception(_formatMessage(file, line))
 88                     {
 89                     }
 90                     
 91 mike      1.2       String ConfigFileSyntaxError::_formatMessage(
 92 kumpf     1.10          const String& file,
 93                         Uint32 line)
 94 mike      1.2       {
 95 dl.meetei 1.13.10.1     char buffer[22];
 96                         Uint32 n;
 97                         const char * startNum=Uint32ToString(buffer,line,n);
 98 mike      1.2       
 99 kumpf     1.10          MessageLoaderParms parms(
100                             "Config.ConfigExceptions.CONFIG_FILE_SYNTAX_ERR",
101                             "Syntax error in configuration file: ");
102 humberto  1.5           String result = MessageLoader::getMessage(parms);
103 kumpf     1.4           result.append(file);
104                         result.append("(");
105 dl.meetei 1.13.10.1     result.append(startNum,n);
106 kumpf     1.4           result.append(")");
107 mike      1.2           return result;
108                     }
109                     
110 dl.meetei 1.13.10.1 
111                     /**
112                         UnrecognizedConfigProperty Exception class
113                     */
114                     UnrecognizedConfigProperty::UnrecognizedConfigProperty(const String& name)
115                         :Exception(
116                             MessageLoaderParms(
117                                 "Config.ConfigExceptions.UNRECOGNIZED_CONFIG_PROPERTY",
118                                 "Unrecognized config property: $0",
119                                 name))
120                     {
121                     }
122                     
123                     /**
124                         NonDynamicConfigProperty Exception class
125                     */
126                     NonDynamicConfigProperty::NonDynamicConfigProperty(const String& name)
127                         :Exception(
128                             MessageLoaderParms(
129                                 "Config.ConfigExceptions.NONDYNAMIC_CONFIG_PROPERTY",
130                                 "NonDynamic config property: $0",
131 dl.meetei 1.13.10.1             name))
132                     {
133                     }
134                     
135                     /**
136                         FailedSaveProperties Exception class
137                     */
138                     FailedSaveProperties::FailedSaveProperties(const String& reason)
139                         :Exception(
140                             MessageLoaderParms(
141                                 "Config.ConfigExceptions.FAILED_SAVE_PROPERTIES",
142                                 "Failed to save configuration properties to file: $0. "
143                                     "Configuration property not set.",
144                                 reason))
145                     {
146                     }
147                     
148 mike      1.2       PEGASUS_NAMESPACE_END

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2