Esempio n. 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;
}
Esempio n. 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;
	}
}
Esempio n. 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();
	}
}
Esempio n. 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;
}
Esempio n. 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";
}