Example #1
0
int Aorders::OpenByName(const AString &s)
{
	AString temp = s;
	file->open(temp.Str(),ios::in);
	if (!(file->rdbuf()->is_open())) return -1;
	return 0;
}
Example #2
0
void Aorders::Open(const AString &s)
{
	while (!(file->rdbuf()->is_open())) {
		AString *name = getfilename(s);
		file->open(name->Str(),ios::in);
		delete name;
	}
}
Example #3
0
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();
	}
}
Example #4
0
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;
}
Example #5
0
const char *AGetNameString(int name)
{
	AString *str;

	forlist(&regionnames) {
		name--;
		if (!name) {
			str = (AString *) elem;
			return str->Str();
		}
	}

	// This should never happen
	return "Error";
}