Back to index

salome-med  6.5.0
MEDLoaderBase.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 #ifndef __MEDLOADERBASE_HXX__
00021 #define __MEDLOADERBASE_HXX__
00022 
00023 #include "MEDLoaderDefines.hxx"
00024 #include "InterpKernelException.hxx"
00025 
00026 #include <string>
00027 
00028 class MEDLOADER_EXPORT MEDLoaderBase
00029 {
00030 public:
00031   static int getStatusOfFile(const char *fileName);
00032   static char *buildEmptyString(int lgth);
00033   static std::string buildUnionUnit(const char *name, int nameLgth, const char *unit, int unitLgth);
00034   static void splitIntoNameAndUnit(const std::string& s, std::string& name, std::string& unit);
00035   static void strip(std::string& s);
00036   static void safeStrCpy(const char *src, int maxLgth, char *dest, int behaviour) throw(INTERP_KERNEL::Exception);
00037   static void safeStrCpy2(const char *src, int maxLgth, char *dest, int behaviour) throw(INTERP_KERNEL::Exception);
00038   static std::string buildStringFromFortran(const char *expr, int lgth);
00039   static void zipEqualConsChar(std::string& s, int minConsSmChar);
00040   static std::string zipString(const char *src, int sizeToRespect);
00041 public:
00042   static const int EXIST_RW=0;
00043   static const int NOT_EXIST=1;
00044   static const int EXIST_RDONLY=2;
00045   static const int EXIST_WRONLY=3;
00046   static const int DIR_LOCKED=4;
00047   static const char WHITE_SPACES[];
00048 };
00049 
00050 #endif