#include <fstream>
#include <iomanip>
#include <ios>
+#include <string>
+
#include <wx/wx.h>
#include <wx/dir.h>
#include <wx/tokenzr.h>
-#include <string.h>
using namespace std;
// Setup the inclusion guard.
cppfile << "#include <iostream>" << endl << endl;
- cppfile << "#ifndef " << outname.c_str() << "_CPP" << endl;
- cppfile << "#define " << outname.c_str() << "_CPP" << endl << endl;
+ cppfile << "#ifndef " << outname.ToStdString() << "_CPP" << endl;
+ cppfile << "#define " << outname.ToStdString() << "_CPP" << endl << endl;
outname.Clear();
outname.Append(wxString::FromUTF8(DirFilenameOnly.c_str()));
// Convert the PNG file into an unsigned char array.
- cppfile << "static unsigned char " << outname.c_str() <<
+ cppfile << "static unsigned char " << outname.ToStdString() <<
"[] = {" << endl;
while (pngfile){
cppfile << "#endif" << endl << endl;
cppfile.close();
- cout << "CPP\t" << CPPFilename.c_str() << endl;
+ cout << "CPP\t" << CPPFilename.ToStdString() << endl;
++*counter;
-
}
void CreateHPPFileDir(wxString dirfilename, wxArrayString filelist,
bool fmatch = FALSE;
wxString finaldirname;
- wxString HPPFilename = dirfilename.c_str();
+ wxString HPPFilename = dirfilename.ToStdString();
wxString DirFilenameOnly;
wxString HPPFilenameOnly;
#endif
hppfile << "#include <iostream>" << endl << endl;
- hppfile << "#ifndef " << finaldirname.c_str() << "_H" << endl;
- hppfile << "#define " << finaldirname.c_str() << "_H" << endl << endl;
+ hppfile << "#ifndef " << finaldirname.ToStdString() << "_H" << endl;
+ hppfile << "#define " << finaldirname.ToStdString() << "_H" << endl << endl;
hppfile << "// List all CPP files in the directory." << endl << endl;
// Write each CPP file into the header file.
CPPFileOnly.RemoveLast(4);
CPPFileOnly.Append(wxT(".cpp"));
- hppfile << "#include \"" << DirFilenameOnly.c_str() <<
- "/" << CPPFileOnly.c_str() << "\"" << endl;
+ hppfile << "#include \"" << DirFilenameOnly.ToStdString() <<
+ "/" << CPPFileOnly.ToStdString() << "\"" << endl;
}
// Increment the HPP file counter.
- cout << "HPPDIR\t" << HPPFilename.c_str() << endl;
+ cout << "HPPDIR\t" << HPPFilename.ToStdString() << endl;
++*counter;
}
DirFilenameWxS.Empty();
- std::cout << BitmapHeaderFilename.c_str() << std::endl;
+ std::cout << BitmapHeaderFilename.ToStdString() << std::endl;
#if defined(__WIN32__)
for (int fi = 0; fi < filelist.GetCount(); fi++)
{
- CreateCPPFile(dirlist[bi].wc_str(), filelist[fi].wc_str(), &cppg);
+ CreateCPPFile(dirlist[bi].ToStdString(), filelist[fi].ToStdString(), &cppg);
fp++;
}
#elif defined(__WIN32__)
- finalhppfile << "#include \"bitmaps\\" << DirNameSplit.c_str() <<
+ finalhppfile << "#include \"bitmaps\\" << DirNameSplit.ToStdString() <<
".h\"" << endl;
#else
- finalhppfile << "#include \"bitmaps/" << DirNameSplit.c_str() <<
+ finalhppfile << "#include \"bitmaps/" << DirNameSplit.ToStdString() <<
".h\"" << endl;
#endif