bool BundleResource::operator ==(const BundleResource& resource) const { if (!this->IsValid()) return !resource.IsValid(); if (!resource.IsValid()) return false; return d->archive->GetResourceContainer() == resource.d->archive->GetResourceContainer() && d->archive->GetResourcePrefix() == resource.d->archive->GetResourcePrefix() && this->GetResourcePath() == resource.GetResourcePath(); }
void ShellService::LoadSchemeResource(const BundleResource& res) { std::cout << "Reading " << res.GetResourcePath(); BundleResourceStream resStream(res); int resBufLen = res.GetSize() + 1; char* resBuf = new char[resBufLen]; resStream.read(resBuf, resBufLen); if (resStream.eof() || resStream.good()) { resBuf[static_cast<std::size_t>(resStream.gcount())] = '\0'; scheme_load_string(d->m_Scheme, resBuf); } else { std::cerr << "Could not read " << res.GetResourcePath() << " file from resource"; } delete[] resBuf; }
bool BundleResource::operator<(const BundleResource& resource) const { return this->GetResourcePath() < resource.GetResourcePath(); }