apicompatanamdw/compatanalysercmd/libraryanalyser/inc/xmlstringtostlstring.hpp
changeset 0 638b9c697799
equal deleted inserted replaced
-1:000000000000 0:638b9c697799
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: 
       
    15 *
       
    16 */
       
    17 #include <xercesc/sax/HandlerBase.hpp>
       
    18 #include <xercesc/sax/AttributeList.hpp>
       
    19 #include <xercesc/util/PlatformUtils.hpp>
       
    20 #include <string>
       
    21 
       
    22 #if !defined XMLSTRTOSTLSTR
       
    23 		#define  XMLSTRTOSTLSTR
       
    24 
       
    25 class XMLStringToSTLString
       
    26 {
       
    27 public:
       
    28 	XMLStringToSTLString(const XMLCh* const toTranscode)
       
    29 	{
       
    30 		str = XMLString::transcode(toTranscode);
       
    31 	}
       
    32 
       
    33 	~XMLStringToSTLString() {}
       
    34 
       
    35 	const std::string& data() const {
       
    36 		return str;
       
    37 	}
       
    38 
       
    39 private:
       
    40 	std::string	str;
       
    41 };
       
    42 
       
    43 inline std::ostream& operator<<(std::ostream& target, const XMLStringToSTLString& toDump)
       
    44 {
       
    45     target << toDump.data();
       
    46     return target;
       
    47 }
       
    48 #endif // XMLSTRTOSTLSTR