wxSprintf(buf, _T("%s.idx"), file_name);
- index_file = wxFopen(buf, _T("r"));
+ index_file = wxFopen(wxFNCONV(buf), _T("r"));
if (index_file == NULL)
return 0;
}
wxSprintf(buf, _T("%s.dat"), file_name);
- data_file = wxFopen(buf, _T("r"));
+ data_file = wxFopen(wxFNCONV(buf), _T("r"));
if (data_file == NULL)
{
if (data_filename)
wxSprintf(buf, _T("%s.dat"), data_filename);
- file = wxFopen(buf, _T("r"));
+ file = wxFopen(wxFNCONV(buf), _T("r"));
if (! (data_filename && file))
{
wxSprintf(error_buf, _T("Poetry data file %s not found\n"), buf);
if (data_filename)
wxSprintf(buf, _T("%s.dat"), data_filename);
- file = wxFopen(buf, _T("r"));
+ file = wxFopen(wxFNCONV(buf), _T("r"));
if (! (data_filename && file))
{
wxSprintf(error_buf, _T("Poetry data file %s not found\n"), buf);
if (index_filename)
wxSprintf(buf, _T("%s.idx"), index_filename);
- file = wxFopen(buf, _T("w"));
+ file = wxFopen(wxFNCONV(buf), _T("w"));
if (! (data_filename && file))
{
wxSprintf(error_buf, _T("Poetry index file %s cannot be created\n"), buf);
} // wxDb::ExecSql()
-/********** wxDb::ExecSql() with column info **********/
+/********** wxDb::ExecSql() with column info **********/
bool wxDb::ExecSql(const wxString &pSqlStmt, wxDbColInf** columns, short& numcols)
{
//execute the statement first
DispAllErrors(henv, hdbc, hstmt);
return false;
}
-
+
if (noCols == 0)
return false;
- else
+ else
numcols = noCols;
-
+
// Get column information
short colNum;
wxChar name[DB_MAX_COLUMN_NAME_LEN+1];
SWORD Sword;
SDWORD Sdword;
wxDbColInf* pColInf = new wxDbColInf[noCols];
-
+
//fill in column information (name, datatype)
- for (colNum = 0; colNum < noCols; colNum++)
+ for (colNum = 0; colNum < noCols; colNum++)
{
if (SQLColAttributes(hstmt, (UWORD)(colNum+1), SQL_COLUMN_NAME,
name, sizeof(name),
delete[] pColInf;
return false;
}
-
+
wxStrncpy(pColInf[colNum].colName, name, DB_MAX_COLUMN_NAME_LEN);
-
+
if (SQLColAttributes(hstmt, (UWORD)(colNum+1), SQL_COLUMN_TYPE,
NULL, 0, &Sword, &Sdword) != SQL_SUCCESS)
{
delete[] pColInf;
return false;
}
-
+
switch (Sdword)
{
case SQL_VARCHAR:
#endif
}
}
-
+
*columns = pColInf;
return true;
} // wxDb::ExecSql()
wxChar typeName[30+1];
SDWORD precision, length;
- FILE *fp = wxFopen(fileName.c_str(),wxT("wt"));
+ FILE *fp = wxFopen(fileName.fn_str(),wxT("wt"));
if (fp == NULL)
return false;
{
if (fpSqlLog == 0)
{
- fpSqlLog = wxFopen(filename, (append ? wxT("at") : wxT("wt")));
+ fpSqlLog = wxFopen(filename.fn_str(), (append ? wxT("at") : wxT("wt")));
if (fpSqlLog == NULL)
return false;
}
void wxPathList::EnsureFileAccessible (const wxString& path)
{
wxString path_only(wxPathOnly(path));
- if ( !path_only.IsEmpty() )
+ if ( !path_only.empty() )
{
if ( !Member(path_only) )
Add(path_only);
void wxStripExtension(wxString& buffer)
{
- //RN: Be careful about the handling the case where
+ //RN: Be careful about the handling the case where
//buffer.Length() == 0
for(size_t i = buffer.Length() - 1; i != wxString::npos; --i)
{
FILE *fp2 = NULL;
FILE *fp3 = NULL;
// Open the inputs and outputs
- if ((fp1 = wxFopen ( file1, wxT("rb"))) == NULL ||
- (fp2 = wxFopen ( file2, wxT("rb"))) == NULL ||
- (fp3 = wxFopen ( outfile, wxT("wb"))) == NULL)
+ if ((fp1 = wxFopen ( file1.fn_str(), wxT("rb"))) == NULL ||
+ (fp2 = wxFopen ( file2.fn_str(), wxT("rb"))) == NULL ||
+ (fp3 = wxFopen ( outfile.fn_str(), wxT("wb"))) == NULL)
{
if (fp1)
fclose (fp1);
#error "Unsupported DOS compiler!"
#endif
#else // !MSW, !DOS and !OS/2 VAC++
- (void)perm;
+ wxUnusedVar(perm);
#ifdef __WXWINCE__
if ( !CreateDirectory(dirname, NULL) )
#else
- if ( wxMkDir(wxFNSTRINGCAST wxFNCONV(dirname)) != 0 )
+ if ( wxMkDir(dir.fn_str()) != 0 )
#endif
#endif // !MSW/MSW
{
wxString wxFindFirstFile(const wxChar *spec, int flags)
{
wxSplitPath(spec, &gs_dirPath, NULL, NULL);
- if ( gs_dirPath.IsEmpty() )
+ if ( gs_dirPath.empty() )
gs_dirPath = wxT(".");
if ( !wxEndsWithPathSeparator(gs_dirPath ) )
gs_dirPath << wxFILE_SEP_PATH;
wxString result;
gs_dir->GetFirst(&result, wxFileNameFromPath(wxString(spec)), dirFlags);
- if ( result.IsEmpty() )
+ if ( result.empty() )
{
wxDELETE(gs_dir);
return result;
wxString result;
gs_dir->GetNext(&result);
- if ( result.IsEmpty() )
+ if ( result.empty() )
{
wxDELETE(gs_dir);
return result;
wxFileInputStream::wxFileInputStream(const wxString& fileName)
: wxInputStream()
{
- m_file = new wxFile(fileName, wxFile::read);
+ m_file = new wxFile(fileName.fn_str(), wxFile::read);
m_file_destroy = true;
}
wxFileOutputStream::wxFileOutputStream(const wxString& fileName)
{
- m_file = new wxFile(fileName, wxFile::write);
+ m_file = new wxFile(fileName.fn_str(), wxFile::write);
m_file_destroy = true;
if (!m_file->IsOpened())