00001 /* 00002 * Copyright 2005-2009 WSO2, Inc. http://wso2.com 00003 * 00004 * Licensed under the Apache License, Version 2.0 (the "License"); 00005 * you may not use this file except in compliance with the License. 00006 * You may obtain a copy of the License at 00007 * 00008 * http://www.apache.org/licenses/LICENSE-2.0 00009 * 00010 * Unless required by applicable law or agreed to in writing, software 00011 * distributed under the License is distributed on an "AS IS" BASIS, 00012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 00013 * See the License for the specific language governing permissions and 00014 * limitations under the License. 00015 */ 00016 00017 #ifndef OMATTRIBUTE_H 00018 #define OMATTRIBUTE_H 00019 00020 #include <WSFDefines.h> 00021 #include <OMNamespace.h> 00022 #include <axiom_attribute.h> 00023 00033 namespace wso2wsf 00034 { 00047 class OMAttribute 00048 { 00055 friend WSF_EXTERN std::ostream & WSF_CALL operator <<(std::ostream & str, OMAttribute const & attribute); 00056 00063 friend WSF_EXTERN std::ostream & WSF_CALL operator <<(std::ostream & str, OMAttribute const * attribute); 00064 00065 private: 00070 axiom_attribute_t * _wsf_axiom_attribute; 00071 00076 OMNamespace * _namespace; 00077 00078 00079 public: 00084 WSF_EXTERN axiom_attribute_t * WSF_CALL getAxiomAttribute(); 00085 00090 WSF_EXTERN void WSF_CALL setAxiomAttribute(axiom_attribute_t * attribute); 00091 00098 WSF_EXTERN WSF_CALL OMAttribute(std::string name, std::string value, OMNamespace * ns); 00099 00105 WSF_EXTERN WSF_CALL OMAttribute(std::string name, std::string value); 00106 00111 WSF_EXTERN WSF_CALL OMAttribute(OMAttribute & attribute); 00112 00116 virtual WSF_CALL ~OMAttribute(); 00117 00123 WSF_EXTERN bool WSF_CALL equals(OMAttribute * attribute); 00124 00129 WSF_EXTERN std::string WSF_CALL getValue(); 00130 00135 WSF_EXTERN std::string WSF_CALL getName(); 00136 00141 WSF_EXTERN OMNamespace * WSF_CALL getNamespace(); 00142 00152 WSF_EXTERN bool WSF_CALL setNamespace(OMNamespace *ns, bool deleteExisting = false); 00153 00158 WSF_EXTERN void WSF_CALL setValue(std::string value); 00159 00164 WSF_EXTERN virtual std::string WSF_CALL toString(); 00165 }; 00168 inline std::ostream & WSF_CALL operator <<(std::ostream & str, OMAttribute const & attribute) 00169 { 00170 return str << const_cast<OMAttribute &>(attribute).toString(); 00171 } 00172 00173 inline std::ostream & WSF_CALL operator <<(std::ostream & str, OMAttribute const * attribute) 00174 { 00175 return str << const_cast<OMAttribute *>(attribute)->toString(); 00176 } 00177 } 00178 #endif // OMATTRIBUTE_H