qname.cxx 480 B

1234567891011121314151617181920212223242526272829303132
  1. // file : xml/qname.cxx
  2. // copyright : Copyright (c) 2013-2014 Code Synthesis Tools CC
  3. // license : MIT; see accompanying LICENSE file
  4. #include <ostream>
  5. #include <xml/qname>
  6. using namespace std;
  7. namespace xml
  8. {
  9. string qname::
  10. string () const
  11. {
  12. std::string r;
  13. if (!ns_.empty ())
  14. {
  15. r += ns_;
  16. r += '#';
  17. }
  18. r += name_;
  19. return r;
  20. }
  21. ostream&
  22. operator<< (ostream& os, const qname& qn)
  23. {
  24. return os << qn.string ();
  25. }
  26. }