LocatorImpl.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. //
  2. // LocatorImpl.h
  3. //
  4. // Library: XML
  5. // Package: SAX
  6. // Module: SAX
  7. //
  8. // An implementation of the SAX Locator interface.
  9. //
  10. // Copyright (c) 2004-2006, Applied Informatics Software Engineering GmbH.
  11. // and Contributors.
  12. //
  13. // SPDX-License-Identifier: BSL-1.0
  14. //
  15. #ifndef SAX_LocatorImpl_INCLUDED
  16. #define SAX_LocatorImpl_INCLUDED
  17. #include "Poco/XML/XML.h"
  18. #include "Poco/SAX/Locator.h"
  19. #include "Poco/XML/XMLString.h"
  20. namespace Poco {
  21. namespace XML {
  22. class XML_API LocatorImpl: public Locator
  23. /// Provide an optional convenience implementation of Locator.
  24. {
  25. public:
  26. LocatorImpl();
  27. /// Zero-argument constructor.
  28. ///
  29. /// This will not normally be useful, since the main purpose of this class is
  30. /// to make a snapshot of an existing Locator.
  31. LocatorImpl(const Locator& loc);
  32. /// Copy constructor.
  33. ///
  34. /// Create a persistent copy of the current state of a locator. When the original
  35. /// locator changes, this copy will still keep the original values (and it can be
  36. /// used outside the scope of DocumentHandler methods).
  37. ~LocatorImpl();
  38. /// Destroys the Locator.
  39. LocatorImpl& operator = (const Locator& loc);
  40. /// Assignment operator.
  41. XMLString getPublicId() const;
  42. /// Return the saved public identifier.
  43. XMLString getSystemId() const;
  44. /// Return the saved system identifier.
  45. int getLineNumber() const;
  46. /// Return the saved line number (1-based).
  47. int getColumnNumber() const;
  48. /// Return the saved column number (1-based).
  49. void setPublicId(const XMLString& publicId);
  50. /// Set the public identifier for this locator.
  51. void setSystemId(const XMLString& systemId);
  52. /// Set the system identifier for this locator.
  53. void setLineNumber(int lineNumber);
  54. /// Set the line number for this locator (1-based).
  55. void setColumnNumber(int columnNumber);
  56. /// Set the column number for this locator (1-based).
  57. private:
  58. XMLString _publicId;
  59. XMLString _systemId;
  60. int _lineNumber;
  61. int _columnNumber;
  62. };
  63. } } // namespace Poco::XML
  64. #endif // SAX_LocatorImpl_INCLUDED