Chromium Embedded Framework (CEF)  131.2.1+ge081753+chromium-131.0.6778.13
CefZipArchive Class Reference

Thread-safe class for accessing zip archive file contents. More...

#include "include/wrapper/cef_zip_archive.h"

Inheritance diagram for CefZipArchive:
base::RefCountedThreadSafe< CefZipArchive >

Classes

class  File
 Class representing a file in the archive. More...
 

Public Types

using FileMap = std::map< CefString, CefRefPtr< File > >
 

Public Member Functions

 CefZipArchive ()
 Create a new object. More...
 
 CefZipArchive (const CefZipArchive &)=delete
 
CefZipArchiveoperator= (const CefZipArchive &)=delete
 
size_t Load (CefRefPtr< CefStreamReader > stream, const CefString &password, bool overwriteExisting)
 Load the contents of the specified zip archive stream into this object. More...
 
void Clear ()
 Clears the contents of this object. More...
 
size_t GetFileCount () const
 Returns the number of files in the archive. More...
 
bool HasFile (const CefString &fileName) const
 Returns true if the specified file exists and has contents. More...
 
CefRefPtr< FileGetFile (const CefString &fileName) const
 Returns the specified file. More...
 
bool RemoveFile (const CefString &fileName)
 Removes the specified file. More...
 
size_t GetFiles (FileMap &map) const
 Returns the map of all files. More...
 
- Public Member Functions inherited from base::RefCountedThreadSafe< CefZipArchive >
 RefCountedThreadSafe ()
 
 RefCountedThreadSafe (const RefCountedThreadSafe &)=delete
 
RefCountedThreadSafeoperator= (const RefCountedThreadSafe &)=delete
 
void AddRef () const
 
void Release () const
 

Friends

class base::RefCountedThreadSafe< CefZipArchive >
 

Additional Inherited Members

- Static Public Attributes inherited from base::RefCountedThreadSafe< CefZipArchive >
static constexpr cef_subtle::StartRefCountFromZeroTag kRefCountPreference
 
- Protected Member Functions inherited from base::RefCountedThreadSafe< CefZipArchive >
 ~RefCountedThreadSafe ()=default
 

Detailed Description

Thread-safe class for accessing zip archive file contents.

This class should not be used with large archive files because all data will be resident in memory at the same time. This implementation supports a restricted set of zip archive features:

  1. All file names are stored and compared in lower case.
  2. File ordering from the original zip archive is not maintained. This means that files from the same folder may not be located together in the file content map.

Member Typedef Documentation

◆ FileMap

Constructor & Destructor Documentation

◆ CefZipArchive() [1/2]

CefZipArchive::CefZipArchive ( )

Create a new object.

◆ CefZipArchive() [2/2]

CefZipArchive::CefZipArchive ( const CefZipArchive )
delete

Member Function Documentation

◆ Clear()

void CefZipArchive::Clear ( )

Clears the contents of this object.

◆ GetFile()

CefRefPtr<File> CefZipArchive::GetFile ( const CefString fileName) const

Returns the specified file.

◆ GetFileCount()

size_t CefZipArchive::GetFileCount ( ) const

Returns the number of files in the archive.

◆ GetFiles()

size_t CefZipArchive::GetFiles ( FileMap map) const

Returns the map of all files.

◆ HasFile()

bool CefZipArchive::HasFile ( const CefString fileName) const

Returns true if the specified file exists and has contents.

◆ Load()

size_t CefZipArchive::Load ( CefRefPtr< CefStreamReader stream,
const CefString password,
bool  overwriteExisting 
)

Load the contents of the specified zip archive stream into this object.

If the zip archive requires a password then provide it via |password|. If |overwriteExisting| is true then any files in this object that also exist in the specified archive will be replaced with the new files. Returns the number of files successfully loaded.

◆ operator=()

CefZipArchive& CefZipArchive::operator= ( const CefZipArchive )
delete

◆ RemoveFile()

bool CefZipArchive::RemoveFile ( const CefString fileName)

Removes the specified file.

Friends And Related Function Documentation

◆ base::RefCountedThreadSafe< CefZipArchive >

friend class base::RefCountedThreadSafe< CefZipArchive >
friend

The documentation for this class was generated from the following file: