Version: 5.1.6

MEDLoaderBase Class Reference

#include <MEDLoaderBase.hxx>

Static Public Member Functions

static int getStatusOfFile (const char *fileName)
static char * buildEmptyString (int lgth)
static std::string buildUnionUnit (const char *name, int nameLgth, const char *unit, int unitLgth)
static void splitIntoNameAndUnit (const std::string &s, std::string &name, std::string &unit)
static void strip (std::string &s)
static void safeStrCpy (const char *src, int maxLgth, char *dest, int behaviour) throw (INTERP_KERNEL::Exception)
static std::string buildStringFromFortran (const char *expr, int lgth)
static void zipEqualConsChar (std::string &s, int minConsSmChar)
static std::string zipString (const char *src, int sizeToRespect)

Static Public Attributes

static const int EXIST_RW = 0
static const int NOT_EXIST = 1
static const int EXIST_RDONLY = 2
static const int EXIST_WRONLY = 3
static const int DIR_LOCKED = 4
static const char WHITE_SPACES [] = " \n"

Member Function Documentation

int MEDLoaderBase::getStatusOfFile ( const char *  fileName  )  [static]

References EXIST_RDONLY, EXIST_RW, and NOT_EXIST.

char * MEDLoaderBase::buildEmptyString ( int  lgth  )  [static]

References MEDMEM.fill(), and testMEDMEM.ret.

std::string MEDLoaderBase::buildUnionUnit ( const char *  name,
int  nameLgth,
const char *  unit,
int  unitLgth 
) [static]
void MEDLoaderBase::splitIntoNameAndUnit ( const std::string &  s,
std::string &  name,
std::string &  unit 
) [static]

References testDriverAscii.f1, and strip().

void MEDLoaderBase::strip ( std::string &  s  )  [static]

References testDriverAscii.f1.

void MEDLoaderBase::safeStrCpy ( const char *  src,
int  maxLgth,
char *  dest,
int  behaviour 
) throw (INTERP_KERNEL::Exception) [static]

This method operates a safe copy from 'src' to 'dest' by checking the size of 'src' before trying to copy. If size of 'src' string is higher than 'maxLgth' the behaviour is dependant from 'behaviour' parameter. If 'behaviour' equals 0 an exception is thrown. If 'behaviour' equals 1 an attempt of zipping of string will be done ( see zipString to have more details).

References TestMedCorba7.s.

std::string MEDLoaderBase::buildStringFromFortran ( const char *  expr,
int  lgth 
) [static]

References testMEDMEM.ret, and WHITE_SPACES.

void MEDLoaderBase::zipEqualConsChar ( std::string &  s,
int  minConsSmChar 
) [static]

This method see if there is in 's' more than 'minConsSmChar' consecutive same character. If yes, the group will be zipped using only one character for this group. If no such group is found, s remains unchanged.

References Med_Gen_test.it.

std::string MEDLoaderBase::zipString ( const char *  src,
int  sizeToRespect 
) [static]

This method given the target size to respect 'sizeToRespect' tries to reduce size of 'src' string. This method uses several soft methods to do its job. But if it fails a simple cut of string will be performed.

References TestMedCorba7.s, strip(), and zipEqualConsChar().


Field Documentation

const int MEDLoaderBase.EXIST_RW = 0 [static]
const int MEDLoaderBase.NOT_EXIST = 1 [static]
const int MEDLoaderBase.EXIST_RDONLY = 2 [static]
const int MEDLoaderBase.EXIST_WRONLY = 3 [static]
const int MEDLoaderBase.DIR_LOCKED = 4 [static]
const char MEDLoaderBase::WHITE_SPACES = " \n" [static]