Пример #1
0
	static void GoToNN(vfsStream& f)
	{
		while(!f.Eof())
		{
			char c;
			f.Read(&c, 1);
			if(c != 0)
			{
				f.Seek(f.Tell() - 1);
				break;
			}
		}
	}
Пример #2
0
	bool loader::load(vfsStream& stream)
	{
		for (auto i : m_handlers)
		{
			i->set_status(i->init(stream));
			if (i->get_status() == handler::ok)
			{
				i->set_status(i->load());
				if (i->get_status() == handler::ok)
				{
					return true;
				}

				LOG_NOTICE(LOADER, "loader::load() failed: %s", i->get_error_code().c_str());
			}
			else
			{
				LOG_NOTICE(LOADER, "loader::init() failed: %s", i->get_error_code().c_str());
				stream.Seek(i->get_stream_offset());
			}
		}

		return false;
	}