X-Git-Url: http://www.project-moonshot.org/gitweb/?a=blobdiff_plain;f=xmltooling%2Funicode.h;h=8e1e300f14eaba254343043d4eac823a64af1bd8;hb=5cb314df178f78c6fa7b9826c2c5a5298ec7a473;hp=b4bd11129604d21b32250bbfe5063749ce7dcb5c;hpb=e7a65d784215bc04355f014141219b3e7ab4559a;p=shibboleth%2Fcpp-xmltooling.git diff --git a/xmltooling/unicode.h b/xmltooling/unicode.h index b4bd111..8e1e300 100644 --- a/xmltooling/unicode.h +++ b/xmltooling/unicode.h @@ -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. @@ -20,12 +20,14 @@ * Helper classes and types for manipulating Unicode */ -#if !defined(__xmltooling_unicode_h__) +#ifndef __xmltooling_unicode_h__ #define __xmltooling_unicode_h__ +#include + #include +#include #include -#include 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. *