Update of /cvsroot/gcblue/gcb_wx/src/common
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29922/src/common
Modified Files:
tcFile.cpp
Log Message:
Start of save to python feature
Index: tcFile.cpp
===================================================================
RCS file: /cvsroot/gcblue/gcb_wx/src/common/tcFile.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** tcFile.cpp 8 Aug 2004 00:31:33 -0000 1.5
--- tcFile.cpp 10 Dec 2005 16:52:02 -0000 1.6
***************
*** 47,52 ****
int tcFile::Close()
{
! if (mpFile == NULL) {return false;}
! return fclose(mpFile);
}
--- 47,57 ----
int tcFile::Close()
{
! if (mpFile == 0) {return false;}
! int val = fclose(mpFile);
! if (val == 0)
! {
! mpFile = 0;
! }
! return val;
}
***************
*** 151,160 ****
! tcFile::tcFile(void)
{
- mpFile = NULL;
}
! tcFile::~tcFile(void)
{
}
--- 156,178 ----
! tcFile::tcFile()
! : mpFile(0)
{
}
! tcFile::tcFile(const std::string& fileName)
! : mpFile(0)
! {
! if (Open(fileName.c_str(), modeWrite | modeText) == 0)
! {
! fprintf(stderr, "tcFile::tcFile - Error opening %s\n", fileName.c_str());
! }
! }
!
! tcFile::~tcFile()
{
+ if (IsOpen())
+ {
+ Close();
+ }
}
|