예제 #1
0
FileHandle open_file_with_exception(const string& filename, const string& mode)
{
  FileHandle f(open_file_raw(filename, mode), fclose);
  if (!f)
    throw runtime_error("Cannot open " + filename);
  return f;
}
예제 #2
0
	FILE* FileSourceFS::OpenWriteStream(const std::string &path, int flags)
	{
		const std::string fullpath = JoinPathBelow(GetRoot(), path);
		return open_file_raw(fullpath, (flags & WRITE_TEXT) ? L"w" : L"wb");
	}
예제 #3
0
	FILE* FileSourceFS::OpenReadStream(const std::string &path)
	{
		const std::string fullpath = JoinPathBelow(GetRoot(), path);
		return open_file_raw(fullpath, L"rb");
	}
예제 #4
0
FileHandle open_file(const string& filename, const string& mode)
{
  return FileHandle(open_file_raw(filename, mode), fclose);
}