int Aorders::OpenByName(const AString &s) { AString temp = s; file->open(temp.Str(),ios::in); if (!(file->rdbuf()->is_open())) return -1; return 0; }
void Aorders::Open(const AString &s) { while (!(file->rdbuf()->is_open())) { AString *name = getfilename(s); file->open(name->Str(),ios::in); delete name; } }
void Aoutfile::Open(const AString &s) { while(!(file->rdbuf()->is_open())) { AString *name = getfilename(s); file->open(name->Str(), ios::out|ios::ate); delete name; // Handle a broke ios::ate implementation on some boxes file->seekp(0, ios::end); if((int)file->tellp()!= 0) file->close(); } }
int Aoutfile::OpenByName(const AString &s) { AString temp = s; file->open(temp.Str(), ios::out|ios::ate); if(!file->rdbuf()->is_open()) return -1; // Handle a broke ios::ate implementation on some boxes file->seekp(0, ios::end); if((int)file->tellp() != 0) { file->close(); return -1; } return 0; }
const char *AGetNameString(int name) { AString *str; forlist(®ionnames) { name--; if (!name) { str = (AString *) elem; return str->Str(); } } // This should never happen return "Error"; }