Update copyright.
[shibboleth/cpp-xmltooling.git] / xmltooling / unicode.h
index b4bd111..8e1e300 100644 (file)
@@ -1,5 +1,5 @@
 /*
- *  Copyright 2001-2006 Internet2
+ *  Copyright 2001-2007 Internet2
  * 
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * Helper classes and types for manipulating Unicode
  */
  
-#if !defined(__xmltooling_unicode_h__)
+#ifndef __xmltooling_unicode_h__
 #define __xmltooling_unicode_h__
 
+#include <xmltooling/base.h>
+
 #include <string>
+#include <iostream>
 #include <xercesc/util/XMLString.hpp>
-#include <xmltooling/base.h>
 
 using namespace xercesc;
 
@@ -54,6 +56,15 @@ namespace xmltooling {
     extern XMLTOOL_API XMLCh* fromUTF8(const char* src);
 
     /**
+     * Writes a Unicode string to an ASCII stream by transcoding to UTF8.
+     * 
+     * @param ostr  stream to write to
+     * @param s     string to write
+     * @return      reference to output stream
+     */
+    extern XMLTOOL_API std::ostream& operator<<(std::ostream& ostr, const XMLCh* s);
+
+    /**
      * A minimal auto_ptr-like class that can copy or transcode a buffer into
      * the local code page and free the result automatically.
      *