From 91e536f1647e5e1f2b6b7ae6262ef01dd8b32f34 Mon Sep 17 00:00:00 2001 From: abd Date: Fri, 3 Oct 2008 10:25:54 +0000 Subject: [PATCH] Win32 Porting. Correction of Export/Import defines for Win32 platform. Using WIN32 standard define instead WNT define of OpenCascade library. Using Basics instead Utils library. Removed "using namespace std" from header files. Using std:string instead char* for fix bug of std::string::c_str() on local std::string object --- .../SALOMEDSImpl_GenericAttribute.cxx | 14 +++++++--- .../SALOMEDSImpl_GenericAttribute.hxx | 26 ++++++++++--------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.cxx b/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.cxx index 168645bb0..37caac3fb 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.cxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.cxx @@ -28,16 +28,22 @@ using namespace std; -char* SALOMEDSImpl_GenericAttribute::Impl_GetType(DF_Attribute* theAttr) +string SALOMEDSImpl_GenericAttribute::Impl_GetType(DF_Attribute* theAttr) { SALOMEDSImpl_GenericAttribute* ga = dynamic_cast(theAttr); - return (char*)ga->Type().c_str(); + if (ga) + return ga->Type(); + + return ""; } -char* SALOMEDSImpl_GenericAttribute::Impl_GetClassType(DF_Attribute* theAttr) +string SALOMEDSImpl_GenericAttribute::Impl_GetClassType(DF_Attribute* theAttr) { SALOMEDSImpl_GenericAttribute* ga = dynamic_cast(theAttr); - return (char*)ga->GetClassType().c_str(); + if (ga) + return ga->GetClassType(); + + return ""; } void SALOMEDSImpl_GenericAttribute::Impl_CheckLocked(DF_Attribute* theAttr) diff --git a/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.hxx b/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.hxx index 345e0fd64..0fcdb3f5c 100644 --- a/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.hxx +++ b/src/SALOMEDSImpl/SALOMEDSImpl_GenericAttribute.hxx @@ -24,13 +24,15 @@ #ifndef _GENERICIMPL_ATTRIBUTE_HXX_ #define _GENERICIMPL_ATTRIBUTE_HXX_ +#include "SALOMEDSImpl_Defines.hxx" #include "DF_Label.hxx" #include "DF_Attribute.hxx" #include #include "SALOMEDSImpl_SObject.hxx" -class SALOMEDSImpl_GenericAttribute: public DF_Attribute +class SALOMEDSIMPL_EXPORT SALOMEDSImpl_GenericAttribute: + public DF_Attribute { protected: @@ -38,19 +40,19 @@ protected: public: -Standard_EXPORT SALOMEDSImpl_GenericAttribute(const std::string& theType) -:_type(theType) -{} + SALOMEDSImpl_GenericAttribute(const std::string& theType) + :_type(theType) + {} -Standard_EXPORT virtual std::string Type(); -Standard_EXPORT virtual void CheckLocked(); -Standard_EXPORT std::string GetClassType() { return _type; } -Standard_EXPORT SALOMEDSImpl_SObject GetSObject(); -Standard_EXPORT void SetModifyFlag(); + virtual std::string Type(); + virtual void CheckLocked(); + std::string GetClassType() { return _type; } + SALOMEDSImpl_SObject GetSObject(); + void SetModifyFlag(); -Standard_EXPORT static char* Impl_GetType(DF_Attribute* theAttr); -Standard_EXPORT static char* Impl_GetClassType(DF_Attribute* theAttr); -Standard_EXPORT static void Impl_CheckLocked(DF_Attribute* theAttr); + static std::string Impl_GetType(DF_Attribute* theAttr); + static std::string Impl_GetClassType(DF_Attribute* theAttr); + static void Impl_CheckLocked(DF_Attribute* theAttr); }; -- 2.39.2