00001 // Copyright (C) 2007-2011 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 __MEDFILEBASIS_HXX__ 00021 #define __MEDFILEBASIS_HXX__ 00022 00023 #include "InterpKernelException.hxx" 00024 00025 #include <string> 00026 #include <vector> 00027 00028 namespace ParaMEDMEM 00029 { 00030 class MEDFileString 00031 { 00032 public: 00033 MEDFileString(int maxLgth); 00034 ~MEDFileString(); 00035 void set(const char *s) throw(INTERP_KERNEL::Exception); 00036 char *getPointer() { return _content; } 00037 const char *getReprForWrite() const { return _content; } 00038 std::string getRepr() const; 00039 private: 00040 int _max_lgth; 00041 char *_content; 00042 }; 00043 00044 00045 class MEDFileMultiString 00046 { 00047 public: 00048 MEDFileMultiString(int nbOfCompo, int maxLgthPerCompo); 00049 ~MEDFileMultiString(); 00050 void set(int compoId, const char *s); 00051 const char *getReprForWrite() const; 00052 std::vector<std::string> getRepr() const; 00053 std::string getReprPerComp(int compId) const; 00054 private: 00055 int _nb_of_comp; 00056 int _max_lgth_per_comp; 00057 char *_content; 00058 }; 00059 } 00060 00061 #endif