16#include <Read_unsupported_ASCII_file_from_ICEM.h>
17#include <Lire_Fichier.h>
18#include <SFichierBin.h>
19#include <EFichierBin.h>
20#include <Interprete.h>
53 if (*first_caracter!=0)
56 Cerr <<
" -> Look for the byte:";
57 fprintf(stderr,
" %02x <=> ",*first_caracter);
58 Cerr << (
Nom)*first_caracter << finl;
59 Cerr <<
" -> Read the bytes :";
62 while (s.
good() && s.
get_istream().read(&octet,1) && octet!=*first_caracter)
65 fprintf(stderr,
" %02x",octet);
74 Cerr <<
" -> Read the bytes :";
77 while (s.
good() && s.
get_istream().read(&octet,1) && (octet==32 || octet==0 || octet==127) )
80 fprintf(stderr,
" %02x",octet);
85 fprintf(stderr,
" %02x",octet);
88 last_caracter = octet;
95 fprintf(stderr,
" %02x",octet);
98 last_caracter = octet;
102 fprintf(stderr,
" %02x",octet);
107 Cerr <<
" -> Read the string: " << chaine << finl;
109 return last_caracter;
113void check_ICEM_binary_file(
Nom& filename,
const Nom& nom_objet_lu)
125 while(octet!=32 && octet!=0)
126 tmp.get_istream().read(&octet,1);
131 Cerr <<
"==============================================" << finl;
132 Cerr << filename <<
" is an ICEM binary file." << finl;
133 Cerr <<
"To save space, you can now delete this file and use" << finl;
135 Nom new_filename(filename);
136 new_filename+=
".cleaned";
137 Cerr <<
"instead, the newly created " << new_filename <<
" file." << finl;
138 Cerr <<
"==============================================" << finl;
159 Cerr <<
"End of the read of the nodes." << finl;
161 if (read_write_string_from(s,o,
"{")!=123)
163 Cerr <<
"Error in is_a_ICEM_binary_file : { is waited." << finl;
167 read_write_string_from(s,o,
"");
169 read_write_string_from(s,o,
"T");
174 Cerr <<
"End of the read of the cells." << finl;
180 while(read_write_string_from(s,o,sep)!=125)
183 read_write_string_from(s,o,
"");
185 read_write_string_from(s,o,
"T");
190 IntTab faces_voisins;
193 Cerr <<
"End of the read of a boundary." << finl;
197 for (
int i=0; i<3; i++)
199 if (read_write_string_from(s,o,
"v")!=101)
201 Cerr <<
"Error in is_a_ICEM_binary_file : 'vide' is waited." << finl;
206 if (read_write_string_from(s,o,
"}")!=125)
208 Cerr <<
"Error in is_a_ICEM_binary_file : } is waited." << finl;
212 read_write_string_from(s,o,
"v");
216 filename=new_filename;
217 Cerr <<
"=============================================" << finl;
218 Cerr <<
"You can use now: " << finl;
219 Cerr <<
"Lire_fichier " << nom_objet_lu <<
" "<< filename << finl;
220 Cerr <<
"=============================================" << finl;
224void check_ICEM_ascii_file(
const Nom& filename,
const Lire_Fichier& keyword)
229 Cerr <<
"Since the 1.6.7 version, the read of an ASCII file from ICEM mesh tool is not" << finl;
230 Cerr <<
"supported anymore cause insufficient number of digits to define the node coordinates." <<finl;
231 Cerr <<
"Please, use the TRUST binary export from ICEM." << finl;
236 Cerr <<
"====================================================" << finl;
237 Cerr <<
"Warning: You are using an obsolete feature of TRUST" << finl;
238 Cerr <<
"with Unsupported_ASCII_file_read_from_ICEM keyword." << finl;
239 Cerr <<
"Use binary format for ICEM file!" << finl;
240 Cerr <<
"====================================================" << finl;
Lecture dans un fichier d'objets ecrits au format binaire.
Class defining operators and methods for all reading operation in an input flow (file,...
virtual istream & get_istream()
static Objet_U & objet(const Nom &)
Voir Interprete_bloc::objet_global() BM: la classe Interprete n'est pas le meilleur endroit pour cett...
class Lire_Fichier Lecture d'un fichier
class Nom Une chaine de caractere pour nommer les objets de TRUST
classe Objet_U Cette classe est la classe de base des Objets de TRUST
const Nom & que_suis_je() const
renvoie la chaine identifiant la classe.
virtual Entree & readOn(Entree &)
Lecture d'un Objet_U sur un flot d'entree Methode a surcharger.
virtual Sortie & printOn(Sortie &) const
Ecriture de l'objet sur un flot de sortie Methode a surcharger.
static void exit(int exit_code=-1)
Routine de sortie de TRUST dans une region Kokkos.
Ecriture dans un fichier d'objets ecrits au format binaire.
ofstream & get_ofstream()
Classe de base des flux de sortie.