mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-25 17:00:34 +05:00
simplification involved by medfile 4.1
This commit is contained in:
parent
bcb3b6e5cd
commit
29fa6f3696
File diff suppressed because one or more lines are too long
@ -78,13 +78,15 @@ namespace MED
|
|||||||
TFile(const TFile&);
|
TFile(const TFile&);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TFile(const std::string& theFileName, TInt theMinor=-1):
|
TFile(const std::string& theFileName, TInt theMajor=-1, TInt theMinor=-1):
|
||||||
myCount(0),
|
myCount(0),
|
||||||
myFid(0),
|
myFid(0),
|
||||||
myFileName(theFileName),
|
myFileName(theFileName),
|
||||||
|
myMajor(theMajor),
|
||||||
myMinor(theMinor)
|
myMinor(theMinor)
|
||||||
{
|
{
|
||||||
if ((myMinor < 0) || (myMinor > MED_MINOR_NUM)) myMinor = MED_MINOR_NUM;
|
if ((myMajor < 0) || (myMajor > MED_MAJOR_NUM)) myMajor = MED_MAJOR_NUM;
|
||||||
|
if ((myMinor < 0) || (myMajor == MED_MAJOR_NUM && myMinor > MED_MINOR_NUM)) myMinor = MED_MINOR_NUM;
|
||||||
}
|
}
|
||||||
|
|
||||||
~TFile()
|
~TFile()
|
||||||
@ -98,7 +100,7 @@ namespace MED
|
|||||||
{
|
{
|
||||||
if (myCount++ == 0) {
|
if (myCount++ == 0) {
|
||||||
const char* aFileName = myFileName.c_str();
|
const char* aFileName = myFileName.c_str();
|
||||||
myFid = MEDfileVersionOpen(aFileName,med_access_mode(theMode), MED_MAJOR_NUM, myMinor, MED_RELEASE_NUM);
|
myFid = MEDfileVersionOpen(aFileName,med_access_mode(theMode), myMajor, myMinor, MED_RELEASE_NUM);
|
||||||
}
|
}
|
||||||
if (theErr)
|
if (theErr)
|
||||||
*theErr = TErr(myFid);
|
*theErr = TErr(myFid);
|
||||||
@ -125,6 +127,7 @@ namespace MED
|
|||||||
TInt myCount;
|
TInt myCount;
|
||||||
TIdt myFid;
|
TIdt myFid;
|
||||||
std::string myFileName;
|
std::string myFileName;
|
||||||
|
TInt myMajor;
|
||||||
TInt myMinor;
|
TInt myMinor;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -187,8 +190,9 @@ namespace MED
|
|||||||
|
|
||||||
//---------------------------------------------------------------
|
//---------------------------------------------------------------
|
||||||
TWrapper
|
TWrapper
|
||||||
::TWrapper(const std::string& theFileName, bool write, TInt theMinor):
|
::TWrapper(const std::string& theFileName, bool write, TInt theMajor, TInt theMinor):
|
||||||
myFile(new TFile(theFileName, theMinor)),
|
myFile(new TFile(theFileName, theMajor, theMinor)),
|
||||||
|
myMajor(theMajor),
|
||||||
myMinor(theMinor)
|
myMinor(theMinor)
|
||||||
{
|
{
|
||||||
TErr aRet;
|
TErr aRet;
|
||||||
|
@ -52,7 +52,7 @@ namespace MED
|
|||||||
TWrapper& operator=(const TWrapper&);
|
TWrapper& operator=(const TWrapper&);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
TWrapper(const std::string& theFileName, bool write, TInt theVersion=-1);
|
TWrapper(const std::string& theFileName, bool write, TInt theMajor=-1, TInt theVersion=-1);
|
||||||
|
|
||||||
virtual
|
virtual
|
||||||
~TWrapper();
|
~TWrapper();
|
||||||
@ -939,6 +939,7 @@ namespace MED
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
PFile myFile;
|
PFile myFile;
|
||||||
|
TInt myMajor;
|
||||||
TInt myMinor;
|
TInt myMinor;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user