Type_Unix;
#elif defined(__WXMAC__)
Type_Mac;
- // if you feel brave, remove the next line
- #error "wxTextFile: code for Mac files is untested."
#else
Type_None;
#error "wxTextFile: unsupported platform."
return FALSE;
}
- #ifdef __MAC__
- #pragma message("wxTextFile::Read() hasn't been tested with Mac files.")
- #endif
-
for ( n = 0; n < nRead; n++ ) {
ch = buf[n];
switch ( ch ) {
// Mac line termination
m_aLines.Add(str);
m_aTypes.Add(Type_Mac);
+ chLast = ch;
str = ch;
}
else {
// replace the old file with this one
return fileTmp.Commit();
}
+
+const char *wxTextFile::GetEOL(Type type)
+ {
+ switch ( type ) {
+ case Type_None: return "";
+ case Type_Unix: return "\n";
+ case Type_Dos: return "\r\n";
+ case Type_Mac: return "\r";
+
+ default:
+ wxFAIL_MSG("bad file type in wxTextFile::GetEOL.");
+ return (const char *) NULL;
+ }
+ }
+