Changeset 17
- Timestamp:
- 02/21/13 17:14:39 (12 years ago)
- Location:
- trunk/tmdmcreator
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tmdmcreator/docs/uml/tmdmcreator/128033.diagram
r16 r17 3 3 classcanvas 128033 class_ref 128033 // TmDmCreator 4 4 draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default 5 xyz 34 .2 74 20005 xyz 34 74.4 2000 6 6 end 7 7 classcanvas 128161 class_ref 128161 // TmDmCopier 8 8 draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default 9 xyz 400. 5 183.9 20009 xyz 400.3 184.9 2000 10 10 end 11 11 classcanvas 128417 class_ref 141217 // TmDmProcessor 12 12 draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default 13 xyz 332.2 422200013 xyz 196.5 408 2000 14 14 end 15 15 classcanvas 128545 class_ref 141345 // TmDmProcessorSimple 16 16 draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default 17 xyz 443.6 689.1200017 xyz 363.2 588.3 2000 18 18 end 19 19 classcanvas 128801 class_ref 141473 // TmDmProcessorAttributs 20 20 draw_all_relations default hide_attributes default hide_operations default hide_getset_operations default show_members_full_definition default show_members_visibility default show_members_stereotype default show_members_context default show_members_multiplicity default show_members_initialization default show_attribute_modifiers default member_max_width 0 show_parameter_dir default show_parameter_name default package_name_in_tab default class_drawing_mode default drawing_language default show_context_mode default auto_label_position default show_relation_modifiers default show_relation_visibility default show_infonote default shadow default show_stereotype_properties default 21 xyz 55.8 687.1200021 xyz 18.9 694.5 2000 22 22 end 23 23 relationcanvas 128673 relation_ref 128033 // <generalisation> … … 31 31 no_multiplicity_a no_multiplicity_b 32 32 end 33 relationcanvas 129057 relation_ref 128289 // <unidirectional association>34 from ref 128417 z 2001 to ref 12816135 role_a_pos 545 294 3000 no_role_b36 no_multiplicity_a no_multiplicity_b37 33 end 38 end -
trunk/tmdmcreator/docs/uml/tmdmcreator/33.session
r16 r17 5 5 end 6 6 show_stereotypes 7 selected operation_ref 136097 // TmDmProcessorSimple 7 8 open 8 9 class_ref 128161 // TmDmCopier 9 classrelation_ref 128289 // m_Copier (<unidirectional association>)10 operation_ref 136481 // ProcessBlock 10 11 class_ref 141345 // TmDmProcessorSimple 11 12 class_ref 141473 // TmDmProcessorAttributs -
trunk/tmdmcreator/docs/uml/tmdmcreator/tmdmcreator.prj
r16 r17 1 1 format 75 2 2 "tmdmcreator" 3 revision 43 revision 5 4 4 modified_by 33 "lucien" 5 5 … … 359 359 explicit_switch_type "" 360 360 361 classrelation 128289 // m_Copier (<unidirectional association>) 362 relation 128289 ---> 363 a role_name "m_Copier" protected 364 cpp default " ${comment}${static}${mutable}${volatile}${const}${type} * ${name}${value}; 365 " 366 classrelation_ref 128289 // m_Copier (<unidirectional association>) 367 b parent class_ref 128161 // TmDmCopier 361 attribute 148513 "m_FileSrc" 362 protected explicit_type "wxFileName" 363 cpp_decl " ${comment}${static}${mutable}${volatile}${const}${type} ${name}${value}; 364 " 365 java_decl "" 366 php_decl "" 367 python_decl "" 368 idl_decl "" 369 end 370 371 attribute 148641 "m_FileDst" 372 protected explicit_type "wxFileName" 373 cpp_decl " ${comment}${static}${mutable}${volatile}${const}${type} ${name}${value}; 374 " 375 java_decl "" 376 php_decl "" 377 python_decl "" 378 idl_decl "" 368 379 end 369 380 370 381 operation 135585 "TmDmProcessor" 371 382 public explicit_return_type "" 372 nparams 0 373 cpp_decl " ${comment}${inline}${name}${(}${)}${volatile}${throw}; 374 " 375 cpp_def "${comment}${inline}${class}::${name}${(}${)}${volatile}${throw} { 383 nparams 2 384 param in name "src" explicit_type "wxFileName" 385 param in name "dest" explicit_type "wxFileName" 386 cpp_decl " ${comment}${inline}${name}${(}const ${t0} & ${p0}, const ${t1} & ${p1}${)}${volatile}${throw}; 387 " 388 cpp_def "${comment}${inline}${class}::${name}${(}const ${t0} & ${p0}, const ${t1} & ${p1}${)}${volatile}${throw} { 376 389 ${body}} 377 390 " … … 447 460 operation 136097 "TmDmProcessorSimple" 448 461 public explicit_return_type "" 449 nparams 0 450 cpp_decl " ${comment}${inline}${name}${(}${)}${volatile}${throw}; 451 " 452 cpp_def "${comment}${inline}${class}::${name}${(}${)}${volatile}${throw} { 462 nparams 2 463 param in name "src" explicit_type "wxFileName" 464 param in name "dest" explicit_type "wxFileName" 465 cpp_decl " ${comment}${inline}${name}${(}const ${t0} & ${p0}, const ${t1} & ${p1}${)}${volatile}${throw}; 466 " 467 cpp_def "${comment}${inline}${class}::${name}${(}const ${t0} & ${p0}, const ${t1} & ${p1}${)}${volatile}${throw} { 453 468 ${body}} 454 469 " … … 512 527 operation 135841 "TmDmProcessorAttributs" 513 528 public explicit_return_type "" 514 nparams 0 515 cpp_decl " ${comment}${inline}${name}${(}${)}${volatile}${throw}; 516 " 517 cpp_def "${comment}${inline}${class}::${name}${(}${)}${volatile}${throw} { 529 nparams 2 530 param in name "src" explicit_type "wxFileName" 531 param in name "dest" explicit_type "wxFileName" 532 cpp_decl " ${comment}${inline}${name}${(}const ${t0} & ${p0}, const ${t1} & ${p1}${)}${volatile}${throw}; 533 " 534 cpp_def "${comment}${inline}${class}::${name}${(}const ${t0} & ${p0}, const ${t1} & ${p1}${)}${volatile}${throw} { 518 535 ${body}} 519 536 " -
trunk/tmdmcreator/src/tmdmcreator.cpp
r16 r17 17 17 #include "tmdmcreator.h" 18 18 #include "tmdmcopier.h" 19 #include "tmdmprocessor.h" 19 20 20 21 TmDmCreator::TmDmCreator() { … … 92 93 bool TmDmCreator::ProcessFiles(wxArrayString & errorsmsg) { 93 94 errorsmsg.Clear(); 94 // Copy structure to out95 // Copy structure 95 96 TmDmCopier myCopier(m_FileNameOutSQL); 96 97 if (myCopier.CopyFrom(m_FileNameBaseSQL) == false) { … … 104 105 } 105 106 106 107 107 // Process layers 108 TmDmProcessorSimple myLayerProc(m_FileNameUserContent, m_FileNameOutSQL); 109 int myThematicLayersStart = myLayerProc.FindBlock(_T("thematic_layers")); 110 if (myThematicLayersStart == wxNOT_FOUND) { 111 errorsmsg.Add(wxString::Format(_("'thematic_layers' field not found in %s"), m_FileNameUserContent.GetFullPath())); 112 return false; 113 } 114 if (myLayerProc.ProcessBlock(myThematicLayersStart)==false) { 115 errorsmsg.Add(wxString::Format(_("Processing 'thematic_layers' failed in %s"), m_FileNameUserContent.GetFullPath())); 116 return false; 117 } 108 118 return true; 109 119 } -
trunk/tmdmcreator/src/tmdmprocessor.cpp
r16 r17 18 18 #include "tmdmcopier.h" 19 19 20 TmDmProcessor::TmDmProcessor() { 20 TmDmProcessor::TmDmProcessor(const wxFileName & src, const wxFileName & dest) { 21 m_FileSrc = src; 22 m_FileDst = dest; 21 23 } 22 24 … … 29 31 30 32 int 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 } 31 43 return wxNOT_FOUND; 32 44 } … … 39 51 40 52 41 TmDmProcessorSimple::TmDmProcessorSimple( ) {53 TmDmProcessorSimple::TmDmProcessorSimple(const wxFileName & src, const wxFileName & dest) : TmDmProcessor(src,dest) { 42 54 } 43 55 … … 49 61 50 62 51 bool TmDmProcessorSimple::ProcessBlock(int blockstart, TmDmCopier * copier) { 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 52 89 return false; 53 90 } … … 61 98 62 99 63 TmDmProcessorAttributs::TmDmProcessorAttributs( ) {100 TmDmProcessorAttributs::TmDmProcessorAttributs(const wxFileName & src, const wxFileName & dest) : TmDmProcessor(src,dest) { 64 101 } 65 102 … … 67 104 } 68 105 69 bool TmDmProcessorAttributs::ProcessBlock(int blockstart , TmDmCopier * copier) {106 bool TmDmProcessorAttributs::ProcessBlock(int blockstart) { 70 107 return false; 71 108 } -
trunk/tmdmcreator/src/tmdmprocessor.h
r16 r17 17 17 #define _TMDMPROCESSOR_H_ 18 18 19 // For compilers that support precompilation, includes "wx/wx.h".20 19 #include "wx/wxprec.h" 21 22 // Include wxWidgets' headers23 20 #ifndef WX_PRECOMP 24 21 #include <wx/wx.h> 25 22 #endif 23 #include <wx/filename.h> 24 #include <wx/wfstream.h> 25 #include <wx/txtstrm.h> 26 26 27 27 28 class TmDmCopier; 28 29 class TmDmProcessor { 29 30 protected: 30 TmDmCopier * m_Copier; 31 wxFileName m_FileSrc; 32 wxFileName m_FileDst; 31 33 32 34 public: 33 TmDmProcessor( );35 TmDmProcessor(const wxFileName & src, const wxFileName & dest); 34 36 virtual ~TmDmProcessor(); 35 37 36 38 int FindBlock(const wxString & blockname); 37 virtual bool ProcessBlock(int blockstart , TmDmCopier * copier) = 0;39 virtual bool ProcessBlock(int blockstart) = 0; 38 40 }; 39 41 … … 46 48 class TmDmProcessorSimple : public TmDmProcessor { 47 49 public: 48 TmDmProcessorSimple( );50 TmDmProcessorSimple(const wxFileName & src, const wxFileName & dest); 49 51 virtual ~TmDmProcessorSimple(); 50 52 51 virtual bool ProcessBlock(int blockstart , TmDmCopier * copier);53 virtual bool ProcessBlock(int blockstart); 52 54 }; 53 55 … … 60 62 class TmDmProcessorAttributs : public TmDmProcessor { 61 63 public: 62 TmDmProcessorAttributs( );64 TmDmProcessorAttributs(const wxFileName & src, const wxFileName & dest); 63 65 virtual ~TmDmProcessorAttributs(); 64 66 65 virtual bool ProcessBlock(int blockstart , TmDmCopier * copier);67 virtual bool ProcessBlock(int blockstart); 66 68 }; 67 69 #endif
Note: See TracChangeset
for help on using the changeset viewer.