Back to index

salome-med  6.5.0
Namespaces | Functions
TestOpenMED.cxx File Reference
#include "MEDMEMTest_Utils.hxx"
#include <string>
#include <iostream>
#include <med.h>
#include <med_proto.h>

Go to the source code of this file.

Namespaces

namespace  med_2_3

Functions

med_idt med_2_3::_MEDdatagroupOuvrir (med_idt pid, char *nom)
med_err med_2_3::_MEDdatagroupFermer (med_idt id)
int main (int argc, char **argv)

Function Documentation

int main ( int  argc,
char **  argv 
)

Definition at line 36 of file TestOpenMED.cxx.

{
  cout<<"test start"<<endl;

  std::string filename = getResourceFile("pointe.med");

  med_2_3::med_idt medIdt = med_2_3::MEDouvrir( (const_cast <char *> (filename.c_str())),
                                                 med_2_3::MED_LECTURE_ECRITURE);

  cout<<"The idt of file "<<filename<<" is : "<<medIdt<<endl;

  if(medIdt > 0) {
    cout<<"File is opened in mode MED_LECTURE_ECRITURE"<<endl;
    int err = med_2_3::MEDfermer(medIdt);
    if (err != 0)
      cout<<"Error when closing file !"<<endl;
  }
  else {
    cout<<"Could not open file in mode MED_LECTURE_ECRITURE"<<endl;
  }

  medIdt = med_2_3::MEDouvrir( (const_cast <char *> (filename.c_str())),
                               med_2_3::MED_LECTURE);

  cout<<"The idt of file "<<filename<<" is : "<<medIdt<<endl;

  if(medIdt > 0) {
    cout<<"File is opened in mode MED_LECTURE"<<endl;
    int err = med_2_3::MEDfermer(medIdt);
    if (err != 0)
      cout<<"Error when closing file !"<<endl;
  }
  else {
    cout<<"Could not open file in mode MED_LECTURE"<<endl;
  }

  cout<<"test end"<<endl;

  return 1;
}

Here is the call graph for this function: