Donner SVG main
0.8.0 ยท 64d9612f0.8.0 main
SVG editor and embeddable C⁠+⁠+⁠20 engine.
Loading...
Searching...
No Matches
XMLDocument.h File Reference
#include <cstdint>
#include <memory>
#include <optional>
#include <ostream>
#include <span>
#include <string>
#include <string_view>
#include <vector>
#include "donner/base/EcsRegistry.h"
#include "donner/base/ParseDiagnostic.h"
#include "donner/base/RcString.h"
#include "donner/base/Utils.h"
#include "donner/base/xml/XMLNode.h"
#include "donner/base/xml/XMLSourceStore.h"
Include dependency graph for XMLDocument.h:
This graph shows which files directly or indirectly include this file:

Classes

struct  donner::xml::XMLAttributeAtSourceOffset
 Result of locating an attribute at a source offset. More...
struct  donner::xml::XMLEditIntent
 Source edit request from an editor/source view. More...
struct  donner::xml::XMLMutation
 XML DOM mutation emitted by an incremental source edit. More...
struct  donner::xml::ApplySourceEditResult
 Result from XMLDocument::applySourceEdit. More...
class  donner::xml::XMLDocument
 Represents an XML document, which holds a collection of XMLNode as the document tree. More...
struct  donner::xml::XMLDocument::NodeInsertion
 One completed source-less node insertion and the source delta insertNode returned. More...

Namespaces

namespace  donner
 Top-level Donner namespace, which is split into different sub-namespaces such as donner::svg and donner::css.
namespace  donner::xml
 XML parsing and document model support.

Enumerations

enum class  donner::xml::ReparseScope : std::uint8_t {
  donner::xml::AttributeValue ,
  donner::xml::OpeningTag ,
  donner::xml::TextNode ,
  donner::xml::ElementSubtree ,
  Document
}
 Local XML reparse scope chosen for a source edit. More...

Functions

std::ostream & donner::xml::operator<< (std::ostream &os, ReparseScope scope)
 Print a ReparseScope.

Class Documentation

◆ donner::xml::XMLAttributeAtSourceOffset

struct donner::xml::XMLAttributeAtSourceOffset

Result of locating an attribute at a source offset.

Class Members
SourceRange location Current full source range of the attribute.
XMLQualifiedName name Attribute name.
XMLNode node Element node that owns the attribute.
char quote = '"' Quote delimiter used for the value.
SourceRange valueLocation Current unquoted value source range.

◆ donner::xml::XMLEditIntent

struct donner::xml::XMLEditIntent

Source edit request from an editor/source view.

Class Members
SourceRange range Source byte range to replace.
string_view replacement Replacement source bytes.
uint64_t sourceVersion = 0 Source version observed by the caller.

◆ donner::xml::ApplySourceEditResult

struct donner::xml::ApplySourceEditResult
Class Members
bool applied = false True if the operation fully applied: source bytes changed and the tree was updated to match. A multi-step operation that fails partway still commits its completed source replacements, so check sourceDeltas for the exact record of committed changes rather than assuming applied false means untouched bytes.
optional< ParseDiagnostic > diagnostic Diagnostic if local reparsing failed.
vector< XMLMutation > mutations DOM mutations emitted by this operation.
ReparseScope scope = ReparseScope::Document Reparse scope selected for the edit. Source edits committed by this operation, in order. Non-empty whenever source bytes changed, even if the operation did not fully apply.
vector< XMLSourceDelta > sourceDeltas

◆ donner::xml::XMLDocument::NodeInsertion

struct donner::xml::XMLDocument::NodeInsertion

One completed source-less node insertion and the source delta insertNode returned.

Class Members
XMLSourceDelta insertion The pure-insertion source delta that inserted the node.
XMLNode node Node that was inserted.