[15] | 1 | /*************************************************************************** |
---|
| 2 | tmdmprocessor.cpp |
---|
| 3 | ------------------- |
---|
[16] | 4 | copyright : (C) 2013 CREALP Lucien Schreiber |
---|
[15] | 5 | email : lucien.schreiber at crealp dot vs dot ch |
---|
| 6 | ***************************************************************************/ |
---|
| 7 | |
---|
| 8 | /*************************************************************************** |
---|
| 9 | * * |
---|
| 10 | * This program is free software; you can redistribute it and/or modify * |
---|
| 11 | * it under the terms of the GNU General Public License as published by * |
---|
| 12 | * the Free Software Foundation; either version 2 of the License, or * |
---|
| 13 | * (at your option) any later version. * |
---|
| 14 | * * |
---|
| 15 | ***************************************************************************/ |
---|
| 16 | |
---|
| 17 | #include "tmdmprocessor.h" |
---|
| 18 | #include "tmdmcopier.h" |
---|
| 19 | |
---|
[17] | 20 | TmDmProcessor::TmDmProcessor(const wxFileName & src, const wxFileName & dest) { |
---|
| 21 | m_FileSrc = src; |
---|
| 22 | m_FileDst = dest; |
---|
[15] | 23 | } |
---|
| 24 | |
---|
[16] | 25 | |
---|
| 26 | |
---|
[15] | 27 | TmDmProcessor::~TmDmProcessor() { |
---|
| 28 | } |
---|
| 29 | |
---|
[16] | 30 | |
---|
| 31 | |
---|
[15] | 32 | int TmDmProcessor::FindBlock(const wxString & blockname) { |
---|
[17] | 33 | wxFileInputStream input(m_FileSrc.GetFullPath()); |
---|
| 34 | wxTextInputStream text(input); |
---|
| 35 | long myLineIndex = 0; |
---|
| 36 | while(input.IsOk() && !input.Eof() ){ |
---|
| 37 | wxString myLine = text.ReadLine(); |
---|
| 38 | if (myLine.StartsWith(blockname)==true){ |
---|
| 39 | return myLineIndex; |
---|
| 40 | } |
---|
| 41 | myLineIndex++; |
---|
| 42 | } |
---|
[16] | 43 | return wxNOT_FOUND; |
---|
[15] | 44 | } |
---|
| 45 | |
---|
[16] | 46 | |
---|
| 47 | |
---|
| 48 | |
---|
| 49 | |
---|
| 50 | |
---|
| 51 | |
---|
| 52 | |
---|
[17] | 53 | TmDmProcessorSimple::TmDmProcessorSimple(const wxFileName & src, const wxFileName & dest) : TmDmProcessor(src,dest) { |
---|
[15] | 54 | } |
---|
| 55 | |
---|
[16] | 56 | |
---|
| 57 | |
---|
[15] | 58 | TmDmProcessorSimple::~TmDmProcessorSimple() { |
---|
| 59 | } |
---|
| 60 | |
---|
[16] | 61 | |
---|
| 62 | |
---|
[17] | 63 | bool TmDmProcessorSimple::ProcessBlock(int blockstart) { |
---|
| 64 | wxString mySQLCols = wxEmptyString; |
---|
| 65 | wxString mySQLTxt = wxEmptyString; |
---|
| 66 | |
---|
| 67 | wxFileInputStream input(m_FileSrc.GetFullPath()); |
---|
| 68 | wxTextInputStream text(input); |
---|
| 69 | long myLineIndex = 0; |
---|
| 70 | while(input.IsOk() && !input.Eof() ){ |
---|
| 71 | if (myLineIndex <= blockstart) { |
---|
| 72 | myLineIndex++; |
---|
| 73 | continue; |
---|
| 74 | } |
---|
| 75 | |
---|
| 76 | wxString myRow = text.ReadLine(); |
---|
| 77 | |
---|
| 78 | // HERE !!! |
---|
| 79 | |
---|
| 80 | |
---|
| 81 | |
---|
| 82 | myLineIndex++; |
---|
| 83 | } |
---|
| 84 | return wxNOT_FOUND; |
---|
| 85 | |
---|
| 86 | |
---|
| 87 | |
---|
| 88 | |
---|
[16] | 89 | return false; |
---|
[15] | 90 | } |
---|
| 91 | |
---|
[16] | 92 | |
---|
| 93 | |
---|
| 94 | |
---|
| 95 | |
---|
| 96 | |
---|
| 97 | |
---|
| 98 | |
---|
| 99 | |
---|
[17] | 100 | TmDmProcessorAttributs::TmDmProcessorAttributs(const wxFileName & src, const wxFileName & dest) : TmDmProcessor(src,dest) { |
---|
[15] | 101 | } |
---|
| 102 | |
---|
| 103 | TmDmProcessorAttributs::~TmDmProcessorAttributs() { |
---|
| 104 | } |
---|
| 105 | |
---|
[17] | 106 | bool TmDmProcessorAttributs::ProcessBlock(int blockstart) { |
---|
[16] | 107 | return false; |
---|
[15] | 108 | } |
---|
| 109 | |
---|