MCPcopy Create free account
hub / github.com/CodingGay/BlackDex / ZipString

Class ZipString

Bcore/src/main/cpp/ziparchive/zip_archive.h:35–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

33};
34
35struct ZipString {
36 const uint8_t* name;
37 uint16_t name_length;
38
39 ZipString() {}
40
41 /*
42 * entry_name has to be an c-style string with only ASCII characters.
43 */
44 explicit ZipString(const char* entry_name);
45
46 bool operator==(const ZipString& rhs) const {
47 return name && (name_length == rhs.name_length) && (memcmp(name, rhs.name, name_length) == 0);
48 }
49
50 bool StartsWith(const ZipString& prefix) const {
51 return name && (name_length >= prefix.name_length) &&
52 (memcmp(name, prefix.name, prefix.name_length) == 0);
53 }
54
55 bool EndsWith(const ZipString& suffix) const {
56 return name && (name_length >= suffix.name_length) &&
57 (memcmp(name + name_length - suffix.name_length, suffix.name, suffix.name_length) == 0);
58 }
59};
60
61/*
62 * Represents information about a zip entry in a zip file.

Callers 1

FindMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected