Coverage Report

Created: 2026-09-06 07:18

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/libetonyek/src/lib/IWORKXMLContextBase.cpp
Line
Count
Source
1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/*
3
 * This file is part of the libetonyek project.
4
 *
5
 * This Source Code Form is subject to the terms of the Mozilla Public
6
 * License, v. 2.0. If a copy of the MPL was not distributed with this
7
 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8
 */
9
10
#include "IWORKXMLContextBase.h"
11
12
#include "libetonyek_utils.h"
13
#include "IWORKToken.h"
14
#include "IWORKXMLParserState.h"
15
16
namespace libetonyek
17
{
18
IWORKXMLContextMinimal::IWORKXMLContextMinimal()
19
0
{
20
0
}
21
22
void IWORKXMLContextMinimal::startOfElement()
23
0
{
24
0
}
25
26
void IWORKXMLContextMinimal::endOfElement()
27
0
{
28
0
}
29
30
IWORKXMLContextElement::IWORKXMLContextElement(IWORKXMLParserState &)
31
0
  : IWORKXMLContextMinimal()
32
0
  , m_id()
33
0
{
34
0
}
35
36
void IWORKXMLContextElement::attribute(const int name, const char *const value)
37
0
{
38
0
  if ((+IWORKToken::NS_URI_SFA | IWORKToken::ID) == name)
39
0
    m_id = value;
40
0
}
41
42
void IWORKXMLContextElement::text(const char *)
43
0
{
44
0
  ETONYEK_DEBUG_MSG(("text content is not expected at this element\n"));
45
0
}
46
47
const boost::optional<ID_t> &IWORKXMLContextElement::getId() const
48
0
{
49
0
  return m_id;
50
0
}
51
52
void IWORKXMLContextElement::setId(const char *value)
53
0
{
54
0
  m_id = value;
55
0
}
56
57
IWORKXMLContextText::IWORKXMLContextText(IWORKXMLParserState &)
58
0
  : IWORKXMLContextMinimal()
59
0
{
60
0
}
61
62
IWORKXMLContextPtr_t IWORKXMLContextText::element(int)
63
0
{
64
0
  ETONYEK_DEBUG_MSG(("no subelement is expected at this element\n"));
65
0
  return IWORKXMLContextPtr_t();
66
0
}
67
68
IWORKXMLContextMixed::IWORKXMLContextMixed(IWORKXMLParserState &)
69
0
  : IWORKXMLContextMinimal()
70
0
{
71
0
}
72
73
IWORKXMLContextEmpty::IWORKXMLContextEmpty(IWORKXMLParserState &)
74
0
  : IWORKXMLContextMinimal()
75
0
  , m_id()
76
0
  , m_ref()
77
0
{
78
0
}
79
80
void IWORKXMLContextEmpty::attribute(const int name, const char *const value)
81
0
{
82
0
  switch (name)
83
0
  {
84
0
  case +IWORKToken::NS_URI_SFA | IWORKToken::ID :
85
0
    m_id = value;
86
0
    break;
87
0
  case +IWORKToken::NS_URI_SFA | IWORKToken::IDREF :
88
0
    m_ref = value;
89
0
    break;
90
0
  default:
91
0
    break;
92
0
  }
93
0
}
94
95
IWORKXMLContextPtr_t IWORKXMLContextEmpty::element(int)
96
0
{
97
0
  ETONYEK_DEBUG_MSG(("no subelement is expected at this element\n"));
98
0
  return IWORKXMLContextPtr_t();
99
0
}
100
101
void IWORKXMLContextEmpty::text(const char *)
102
0
{
103
0
  ETONYEK_DEBUG_MSG(("text content is not expected at this element\n"));
104
0
}
105
106
const boost::optional<ID_t> &IWORKXMLContextEmpty::getId() const
107
0
{
108
0
  return m_id;
109
0
}
110
111
void IWORKXMLContextEmpty::setId(const char *value)
112
0
{
113
0
  m_id = value;
114
0
}
115
116
const boost::optional<ID_t> &IWORKXMLContextEmpty::getRef() const
117
0
{
118
0
  return m_ref;
119
0
}
120
121
}
122
123
/* vim:set shiftwidth=2 softtabstop=2 expandtab: */