mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2025-12-18 15:17:42 +03:00
Refactor ContentOpfParser to use a constexpr for MEDIA_TYPE_NCX
This commit is contained in:
parent
7074deb9ad
commit
8a99436e6a
@ -3,6 +3,10 @@
|
|||||||
#include <HardwareSerial.h>
|
#include <HardwareSerial.h>
|
||||||
#include <ZipFile.h>
|
#include <ZipFile.h>
|
||||||
|
|
||||||
|
namespace {
|
||||||
|
constexpr const char MEDIA_TYPE_NCX[] = "application/x-dtbncx+xml";
|
||||||
|
}
|
||||||
|
|
||||||
bool ContentOpfParser::setup() {
|
bool ContentOpfParser::setup() {
|
||||||
parser = XML_ParserCreate(nullptr);
|
parser = XML_ParserCreate(nullptr);
|
||||||
if (!parser) {
|
if (!parser) {
|
||||||
@ -125,7 +129,7 @@ void XMLCALL ContentOpfParser::startElement(void* userData, const XML_Char* name
|
|||||||
|
|
||||||
self->items[itemId] = href;
|
self->items[itemId] = href;
|
||||||
|
|
||||||
if (mediaType == "application/x-dtbncx+xml") {
|
if (mediaType == MEDIA_TYPE_NCX) {
|
||||||
if (self->tocNcxPath.empty()) {
|
if (self->tocNcxPath.empty()) {
|
||||||
self->tocNcxPath = href;
|
self->tocNcxPath = href;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user