source: trunk/tmdmcreator/src/tmdmprocessor.cpp @ 17

Revision 17, 2.5 KB checked in by lucsch, 12 years ago (diff)

Preliminary code for processing user_content.txt

Line 
1/***************************************************************************
2 tmdmprocessor.cpp
3 -------------------
4 copyright            : (C) 2013 CREALP Lucien Schreiber
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
20TmDmProcessor::TmDmProcessor(const wxFileName & src, const wxFileName & dest) {
21    m_FileSrc = src;
22    m_FileDst = dest;
23}
24
25
26
27TmDmProcessor::~TmDmProcessor() {
28}
29
30
31
32int TmDmProcessor::FindBlock(const wxString & blockname) {
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    }
43    return wxNOT_FOUND;
44}
45
46
47
48
49
50
51
52
53TmDmProcessorSimple::TmDmProcessorSimple(const wxFileName & src, const wxFileName & dest) : TmDmProcessor(src,dest) {
54}
55
56
57
58TmDmProcessorSimple::~TmDmProcessorSimple() {
59}
60
61
62
63bool 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   
89    return false;
90}
91
92
93
94
95
96
97
98
99
100TmDmProcessorAttributs::TmDmProcessorAttributs(const wxFileName & src, const wxFileName & dest) : TmDmProcessor(src,dest) {
101}
102
103TmDmProcessorAttributs::~TmDmProcessorAttributs() {
104}
105
106bool TmDmProcessorAttributs::ProcessBlock(int blockstart) {
107    return false;
108}
109
Note: See TracBrowser for help on using the repository browser.