コード例 #1
0
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();
}
コード例 #2
0
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;
}
コード例 #3
0
ファイル: BundleResource.cpp プロジェクト: 01org/linux-sgx
bool BundleResource::operator<(const BundleResource& resource) const
{
  return this->GetResourcePath() < resource.GetResourcePath();
}