Salome HOME
b31b8c6adcd714fc925bb360a6ce95b6c680c977
[tools/medcoupling.git] / src / MEDLoader / MEDLoaderBase.hxx
1 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef __MEDLOADERBASE_HXX__
21 #define __MEDLOADERBASE_HXX__
22
23 #include "MEDLoaderDefines.hxx"
24 #include "InterpKernelException.hxx"
25
26 #include <string>
27
28 class MEDLOADER_EXPORT MEDLoaderBase
29 {
30 public:
31   static int getStatusOfFile(const char *fileName);
32   static char *buildEmptyString(int lgth);
33   static void getDirAndBaseName(const std::string& fullName, std::string& dirName, std::string& baseName) throw(INTERP_KERNEL::Exception);
34   static std::string getPathSep() throw(INTERP_KERNEL::Exception);
35   static std::string joinPath(const std::string& dirName, const std::string& baseName) throw(INTERP_KERNEL::Exception);
36   static std::string buildUnionUnit(const char *name, int nameLgth, const char *unit, int unitLgth);
37   static void splitIntoNameAndUnit(const std::string& s, std::string& name, std::string& unit);
38   static void strip(std::string& s);
39   static void safeStrCpy(const char *src, int maxLgth, char *dest, int behaviour) throw(INTERP_KERNEL::Exception);
40   static void safeStrCpy2(const char *src, int maxLgth, char *dest, int behaviour) throw(INTERP_KERNEL::Exception);
41   static std::string buildStringFromFortran(const char *expr, int lgth);
42   static void zipEqualConsChar(std::string& s, int minConsSmChar);
43   static std::string zipString(const char *src, int sizeToRespect);
44 public:
45   static const int EXIST_RW=0;
46   static const int NOT_EXIST=1;
47   static const int EXIST_RDONLY=2;
48   static const int EXIST_WRONLY=3;
49   static const int DIR_LOCKED=4;
50   static const char WHITE_SPACES[];
51 };
52
53 #endif