Added primitive for Crossword Exporting.
Added first exporting function
This commit is contained in:
@@ -28,4 +28,10 @@ struct WordInfo {
|
||||
bool direct;
|
||||
};
|
||||
|
||||
struct FilledCrossword {
|
||||
GridType grid;
|
||||
std::vector< WordInfo > words;
|
||||
std::vector< wxString > ans;
|
||||
};
|
||||
|
||||
#endif // CROSSBASETYPES_HPP
|
||||
|
||||
@@ -5,4 +5,23 @@
|
||||
|
||||
#include "crossbasetypes.hpp"
|
||||
|
||||
//wxTextFile::GetEOL()
|
||||
|
||||
void exportToString(const FilledCrossword &cross, const bool prn_ans, wxString &str_out){
|
||||
|
||||
}
|
||||
|
||||
bool exportToFile(const FilledCrossword &cross, const bool prn_ans, const wxString path){
|
||||
wxTextFile f(path);
|
||||
if ( f.Exists() )
|
||||
return false;
|
||||
f.Create();
|
||||
wxString cont;
|
||||
exportToString(cross, prn_ans, cont);
|
||||
f.AddLine(cont);
|
||||
f.Write();
|
||||
f.Close();
|
||||
return true;
|
||||
}
|
||||
|
||||
#endif // CROSSEXPORT_HPP
|
||||
|
||||
Reference in New Issue
Block a user