1 // Copyright (C) 2021-2023 CEA, EDF
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, or (at your option) any later version.
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
20 #ifndef MEDMESHCONVERTERUTILITIES_HXX
21 #define MEDMESHCONVERTERUTILITIES_HXX
23 #include "MEDLoaderDefines.hxx"
33 bool isMeshExtensionCorrect( const std::string& fileName );
35 //~void closeMeshFile(const int gmfMeshID);
39 DRS_EMPTY, // a file contains no mesh with the given name
40 DRS_WARN_RENUMBER, // a file has overlapped ranges of element numbers,
41 // so the numbers from the file are ignored
42 DRS_WARN_SKIP_ELEM, // some elements were skipped due to incorrect file data
43 DRS_WARN_DESCENDING, // some elements were skipped due to descending connectivity
44 DRS_FAIL // general failure (exception etc.)
47 * \brief Class to generate string from any type
49 class Comment : public std::string
51 std::ostringstream _s ;
55 Comment():std::string("") {}
57 Comment(const Comment& c):std::string() {
59 this->std::string::operator=( _s.str() );
62 Comment & operator=(const Comment& c) {
64 this->std::string::operator=( _s.str() );
69 Comment( const T &anything ) {
71 this->std::string::operator=( _s.str() );
75 Comment & operator<<( const T &anything ) {
77 this->std::string::operator=( _s.str() );
81 operator char*() const {
82 return (char*)c_str();
85 std::ostream& Stream() {
90 * \brief Enforce freeing memory allocated by std::vector
92 template <class TVECTOR>
93 void FreeVector(TVECTOR& vec)
98 template <class TVECTOR>
99 void CompactVector(TVECTOR& vec)
109 MEDLOADER_EXPORT Localizer();
110 MEDLOADER_EXPORT ~Localizer();
115 #endif // MEDMESHCONVERTERUTILITIES_HXX