Uploaded image for project: 'Xerces-C++'
  1. Xerces-C++
  2. XERCESC-1164

Forward declaration of classes-namespace problem

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Resolution: Incomplete
    • 2.4.0
    • None
    • DOM
    • None
    • Operating System: Linux
      Platform: PC
    • 27220

    Description

      I created classes that wrap Xerces functionality.
      The users of my classes don't need to know Xerces, only these classes.
      The classes have private pointers to DOMDocument and DOMElement.
      I order to prevent the need to include the xerces header files, I tried to
      forward declare them in my header file like this:
      namespace xercesc {
      class DOMDocument;
      class DOMElement;
      };

      but this didn't compile claiming that namespace aliases can't be used.
      Changing to this:
      XERCES_CPP_NAMESPACE_BEGIN
      class DOMDocument;
      class DOMElement;
      XERCES_CPP_NAMESPACE_END

      worked, but again, my users will have to know these macros (which declared only
      in xerces header files).
      Of course I can change the namespace directly to xercesc_2_5_0, but this will
      force me to to change it each time I upgrade.

      I'm using gcc 3.2.3

      Attachments

        Activity

          People

            Unassigned Unassigned
            amit.flashner@comverse.com Amit Flashner
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: