1 // Copyright (C) 2007-2013 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 // Author : Anthony Geay (CEA/DEN)
21 #ifndef __MEDLOADERBASE_HXX__
22 #define __MEDLOADERBASE_HXX__
24 #include "MEDLoaderDefines.hxx"
25 #include "InterpKernelException.hxx"
29 class MEDLOADER_EXPORT MEDLoaderBase
32 static int getStatusOfFile(const char *fileName);
33 static char *buildEmptyString(int lgth);
34 static void getDirAndBaseName(const std::string& fullName, std::string& dirName, std::string& baseName) throw(INTERP_KERNEL::Exception);
35 static std::string getPathSep() throw(INTERP_KERNEL::Exception);
36 static std::string joinPath(const std::string& dirName, const std::string& baseName) throw(INTERP_KERNEL::Exception);
37 static std::string buildUnionUnit(const char *name, int nameLgth, const char *unit, int unitLgth);
38 static void splitIntoNameAndUnit(const std::string& s, std::string& name, std::string& unit);
39 static void strip(std::string& s);
40 static void safeStrCpy(const char *src, int maxLgth, char *dest, int behaviour) throw(INTERP_KERNEL::Exception);
41 static void safeStrCpy2(const char *src, int maxLgth, char *dest, int behaviour) throw(INTERP_KERNEL::Exception);
42 static std::string buildStringFromFortran(const char *expr, int lgth);
43 static void zipEqualConsChar(std::string& s, int minConsSmChar);
44 static std::string zipString(const char *src, int sizeToRespect);
46 static const int EXIST_RW=0;
47 static const int NOT_EXIST=1;
48 static const int EXIST_RDONLY=2;
49 static const int EXIST_WRONLY=3;
50 static const int DIR_LOCKED=4;
51 static const char WHITE_SPACES[];