apicompatanamdw/compatanalysercmd/libraryanalyser/inc/xmlstringtostlstring.hpp
author noe\swadi
Tue, 12 Jan 2010 14:52:39 +0530
changeset 0 638b9c697799
permissions -rw-r--r--
1. Licenses updated to EPL. 2. New components test cases added to BC Drivers 3. Some minor fixes and few feature additions to CA.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
     1
/*
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
     2
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
     3
* All rights reserved.
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
     4
* This component and the accompanying materials are made available
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
     6
* which accompanies this distribution, and is available
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
     8
*
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
     9
* Initial Contributors:
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    11
*
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    12
* Contributors:
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    13
*
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    14
* Description: 
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    15
*
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    16
*/
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    17
#include <xercesc/sax/HandlerBase.hpp>
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    18
#include <xercesc/sax/AttributeList.hpp>
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    19
#include <xercesc/util/PlatformUtils.hpp>
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    20
#include <string>
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    21
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    22
#if !defined XMLSTRTOSTLSTR
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    23
		#define  XMLSTRTOSTLSTR
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    24
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    25
class XMLStringToSTLString
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    26
{
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    27
public:
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    28
	XMLStringToSTLString(const XMLCh* const toTranscode)
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    29
	{
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    30
		str = XMLString::transcode(toTranscode);
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    31
	}
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    32
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    33
	~XMLStringToSTLString() {}
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    34
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    35
	const std::string& data() const {
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    36
		return str;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    37
	}
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    38
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    39
private:
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    40
	std::string	str;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    41
};
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    42
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    43
inline std::ostream& operator<<(std::ostream& target, const XMLStringToSTLString& toDump)
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    44
{
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    45
    target << toDump.data();
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    46
    return target;
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    47
}
638b9c697799 1. Licenses updated to EPL.
noe\swadi
parents:
diff changeset
    48
#endif // XMLSTRTOSTLSTR