Develop and Download Open Source Software

Browse CVS Repository

Diff of /malonnote/mnModel.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.29 by maloninc, Fri Dec 30 01:34:40 2005 UTC revision 1.31 by maloninc, Tue Jan 3 11:24:44 2006 UTC
# Line 3  Line 3 
3  #include <wx/dir.h>  #include <wx/dir.h>
4  #include <wx/regex.h>  #include <wx/regex.h>
5  #include <iconv.h>  #include <iconv.h>
6    #include <ctype.h>
7    
8  static void   toLower(char* string);  static void   toLower(char* string);
9  static char*  decode(const char* string);  static char*  decode(const char* string);
# Line 461  WikiData::WikiData(wxString* dataDir, wx Line 462  WikiData::WikiData(wxString* dataDir, wx
462                  }                  }
463          }          }
464          fclose(fp);          fclose(fp);
465    
466            isWriteToFile = true;
467  }  }
468    
469  WikiData::WikiData(wxString* dataDir) {  WikiData::WikiData(wxString* dataDir) {
# Line 520  WikiData::WikiData(wxString* dataDir) { Line 523  WikiData::WikiData(wxString* dataDir) {
523          text    = new wxString(buf, conv);          text    = new wxString(buf, conv);
524    
525          if(fp) fclose(fp);          if(fp) fclose(fp);
526    
527            isWriteToFile = false;
528  }  }
529    
530  WikiData::~WikiData()  WikiData::~WikiData()
# Line 625  const wxString* WikiData::getText() Line 630  const wxString* WikiData::getText()
630                  MN_FATAL_ERROR(wxT("failed iconv_open"));                  MN_FATAL_ERROR(wxT("failed iconv_open"));
631          }          }
632    
633          if(text) {          if(text && isWriteToFile == true) {
634                  delete text;                  delete text;
635                  text = NULL;                  text = NULL;
636          }          }
637            else if(text && isWriteToFile == false) {
638                    return text;
639            }
640    
641          text = new wxString();          text = new wxString();
642          sprintf(fullPath, "%s/%s", (const char*)dataDirName->mb_str(), (const char*)fileName->mb_str());          sprintf(fullPath, "%s/%s", (const char*)dataDirName->mb_str(), (const char*)fileName->mb_str());
# Line 724  void WikiData::save() Line 732  void WikiData::save()
732                    
733          free(inbuf);          free(inbuf);
734          free(outbuf);          free(outbuf);
735            
736            isWriteToFile = true;
737  }  }
738    
739  /******* Tools ************************/  /******* Tools ************************/

Legend:
Removed from v.1.29  
changed lines
  Added in v.1.31

Back to OSDN">Back to OSDN
ViewVC Help
Powered by ViewVC 1.1.26