SGMLApplication.C 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178
  1. /*
  2. * CDE - Common Desktop Environment
  3. *
  4. * Copyright (c) 1993-2012, The Open Group. All rights reserved.
  5. *
  6. * These libraries and programs are free software; you can
  7. * redistribute them and/or modify them under the terms of the GNU
  8. * Lesser General Public License as published by the Free Software
  9. * Foundation; either version 2 of the License, or (at your option)
  10. * any later version.
  11. *
  12. * These libraries and programs are distributed in the hope that
  13. * they will be useful, but WITHOUT ANY WARRANTY; without even the
  14. * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  15. * PURPOSE. See the GNU Lesser General Public License for more
  16. * details.
  17. *
  18. * You should have received a copy of the GNU Lesser General Public
  19. * License along with these libraries and programs; if not, write
  20. * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
  21. * Floor, Boston, MA 02110-1301 USA
  22. */
  23. /* $XConsortium: SGMLApplication.C /main/1 1996/07/29 17:03:08 cde-hp $ */
  24. // Copyright (c) 1995 James Clark
  25. // See the file COPYING for copying permission.
  26. #ifdef __GNUG__
  27. #pragma implementation
  28. #endif
  29. #include "splib.h"
  30. #include "Boolean.h"
  31. #include "SGMLApplication.h"
  32. SGMLApplication::~SGMLApplication()
  33. {
  34. }
  35. void SGMLApplication::appinfo(const AppinfoEvent &)
  36. {
  37. }
  38. void SGMLApplication::startDtd(const StartDtdEvent &)
  39. {
  40. }
  41. void SGMLApplication::endDtd(const EndDtdEvent &)
  42. {
  43. }
  44. void SGMLApplication::endProlog(const EndPrologEvent &)
  45. {
  46. }
  47. void SGMLApplication::startElement(const StartElementEvent &)
  48. {
  49. }
  50. void SGMLApplication::endElement(const EndElementEvent &)
  51. {
  52. }
  53. void SGMLApplication::data(const DataEvent &)
  54. {
  55. }
  56. void SGMLApplication::sdata(const SdataEvent &)
  57. {
  58. }
  59. void SGMLApplication::pi(const PiEvent &)
  60. {
  61. }
  62. void SGMLApplication::externalDataEntityRef(const ExternalDataEntityRefEvent &)
  63. {
  64. }
  65. void SGMLApplication::subdocEntityRef(const SubdocEntityRefEvent &)
  66. {
  67. }
  68. void SGMLApplication::commentDecl(const CommentDeclEvent &)
  69. {
  70. }
  71. void SGMLApplication::markedSectionStart(const MarkedSectionStartEvent &)
  72. {
  73. }
  74. void SGMLApplication::markedSectionEnd(const MarkedSectionEndEvent &)
  75. {
  76. }
  77. void SGMLApplication::ignoredChars(const IgnoredCharsEvent &)
  78. {
  79. }
  80. void SGMLApplication::generalEntity(const GeneralEntityEvent &)
  81. {
  82. }
  83. void SGMLApplication::error(const ErrorEvent &)
  84. {
  85. }
  86. void SGMLApplication::openEntityChange(const OpenEntityPtr &)
  87. {
  88. }
  89. SGMLApplication::OpenEntity::OpenEntity()
  90. : count_(0)
  91. {
  92. }
  93. SGMLApplication::OpenEntity::~OpenEntity()
  94. {
  95. }
  96. SGMLApplication::OpenEntityPtr::OpenEntityPtr()
  97. : ptr_(0)
  98. {
  99. }
  100. SGMLApplication::OpenEntityPtr::OpenEntityPtr(const OpenEntityPtr &ptr)
  101. : ptr_(ptr.ptr_)
  102. {
  103. if (ptr_)
  104. ptr_->count_ += 1;
  105. }
  106. SGMLApplication::OpenEntityPtr::~OpenEntityPtr()
  107. {
  108. if (ptr_) {
  109. ptr_->count_ -= 1;
  110. if (ptr_->count_ == 0)
  111. delete ptr_;
  112. }
  113. }
  114. void SGMLApplication::OpenEntityPtr::operator=(OpenEntity *p)
  115. {
  116. if (p)
  117. p->count_ += 1;
  118. if (ptr_) {
  119. ptr_->count_ -= 1;
  120. if (ptr_->count_ == 0)
  121. delete ptr_;
  122. }
  123. ptr_ = p;
  124. }
  125. SGMLApplication::Location::Location()
  126. {
  127. init();
  128. }
  129. SGMLApplication::Location::Location(const OpenEntityPtr &ptr, Position pos)
  130. {
  131. if (ptr)
  132. *this = ptr->location(pos);
  133. else
  134. init();
  135. }
  136. void SGMLApplication::Location::init()
  137. {
  138. entityName.ptr = 0;
  139. entityName.len = 0;
  140. filename.ptr = 0;
  141. filename.len = 0;
  142. lineNumber = (unsigned long)-1;
  143. columnNumber = (unsigned long)-1;
  144. byteOffset = (unsigned long)-1;
  145. entityOffset = (unsigned long)-1;
  146. other = 0;
  147. }