Ignore:
Timestamp:
02/21/13 16:20:42 (11 years ago)
Author:
lucsch
Message:

Copying Base and User SQL files into output file is now working

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tmdmcreator/src/tmdmcopier.cpp

    r15 r16  
    22 tmdmcopier.cpp 
    33 ------------------- 
    4  copyright            : (C) 2013 CREALP Lucien Schreiber  
     4 copyright            : (C) 2013 CREALP Lucien Schreiber 
    55 email                : lucien.schreiber at crealp dot vs dot ch 
    66 ***************************************************************************/ 
     
    1818 
    1919TmDmCopier::TmDmCopier(const wxFileName & destfile) { 
     20    m_File = new wxFFile(); 
     21    bool bOpen = m_File->Open(destfile.GetFullPath(), "a"); 
     22    wxASSERT(bOpen == true); 
    2023} 
    2124 
     25 
     26 
    2227TmDmCopier::~TmDmCopier() { 
     28    wxDELETE(m_File); 
    2329} 
    2430 
    25 void TmDmCopier::SetCopyMode(TMDMCOPIER_MODE value) { 
    26   m_CopyMode = value; 
     31 
     32 
     33bool TmDmCopier::CopyFrom(const wxFileName & filename) { 
     34    wxFFile mySrcFile; 
     35    if (mySrcFile.Open(filename.GetFullPath()) == false) { 
     36        m_Errors.Add(wxString::Format(_("Unable to open: %s"), filename.GetFullPath())); 
     37        return false; 
     38    } 
     39     
     40    wxString mySrcTxt; 
     41    if(mySrcFile.ReadAll(&mySrcTxt)==false){ 
     42        m_Errors.Add(wxString::Format(_("Reading from: %s failed!"), filename.GetFullPath())); 
     43        return false; 
     44    } 
     45    return CopyFrom(mySrcTxt); 
    2746} 
    2847 
    29 bool TmDmCopier::CopyFrom(const wxFileName & filename) { 
     48 
     49 
     50bool TmDmCopier::CopyFrom(const wxString & text) { 
     51    if (m_File->Write(text) == false) { 
     52        m_Errors.Add(wxString::Format(_("Writing to: %s failed!"), m_File->GetName())); 
     53        return false; 
     54    } 
     55     
     56    return true; 
    3057} 
    3158 
    32 bool TmDmCopier::CopyFrom(const wxString & text) { 
     59 
     60 
     61wxArrayString TmDmCopier::GetErrors(){ 
     62    return m_Errors; 
    3363} 
    34  
    35 bool TmDmCopier::IsCopyAllowed() { 
    36 } 
    37  
Note: See TracChangeset for help on using the changeset viewer.