Skip to content
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/xml/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@ install(
FILES
./xmlparser.hpp
./xmlconstants.hpp
./static-dtd.hpp
DESTINATION /usr/local/include
)
6 changes: 6 additions & 0 deletions lib/xml/static-dtd.hpp

Large diffs are not rendered by default.

17 changes: 11 additions & 6 deletions lib/xml/xmlconstants.hpp
Original file line number Diff line number Diff line change
@@ -1,20 +1,25 @@
#pragma once

#include <string>
#include <cstdint>
#include <string_view>

//- NLAP XML start marker: configurable tag used to identify message boundaries
static constexpr std::string_view NLAP_XML_START_MARKER("<NLAP>");

//- NLAP XML end marker: used to split stream data into individual NLAP messages
static const std::string NLAP_XML_END_MARKER("</NLAP>");
static constexpr std::string_view NLAP_XML_END_MARKER("</NLAP>");

//- XML declaration prepended to messages that do not already contain it
static const std::string NLAP_XML_DECLARATION("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");
static constexpr std::string_view NLAP_XML_DECLARATION("<?xml version=\"1.0\" encoding=\"UTF-8\"?>");

//- Path to the NLAP DTD used for validation (override at compile time via -DNLAP_DTD_PATH=...)
#ifndef NLAP_DTD_PATH
#define NLAP_DTD_PATH "specs/xml/nlap.dtd"
#endif

static const std::string NLAP_DTD_SYSTEM_PATH(NLAP_DTD_PATH);
static const std::string_view NLAP_DTD_SYSTEM_PATH(NLAP_DTD_PATH);

//- constant expressions (error)
constexpr uint16_t XML_ERROR_PARSE_BUFFER_EXCEEDED = 10;
constexpr uint16_t XML_ERROR_BAD_REQUEST = 400;
constexpr uint16_t XML_ERROR_INVALID_CONTENT_DTD = 10;
constexpr uint16_t XML_ERROR_INVALID_SYNTAX = 20;
constexpr uint16_t XML_ERROR_INVALID_FRAMING = 30;
Loading
Loading