/* Code generated by IfcQuery EXPRESS generator, www.ifcquery.com */

#include <sstream>
#include <limits>
#include <map>
#include "ifcpp/reader/ReaderUtil.h"
#include "ifcpp/writer/WriterUtil.h"
#include "ifcpp/model/BasicTypes.h"
#include "ifcpp/model/BuildingException.h"
#include "ifcpp/IFC4/include/IfcInternalOrExternalEnum.h"

// TYPE IfcInternalOrExternalEnum = ENUMERATION OF	(INTERNAL	,EXTERNAL	,EXTERNAL_EARTH	,EXTERNAL_WATER	,EXTERNAL_FIRE	,NOTDEFINED);
IfcInternalOrExternalEnum::~IfcInternalOrExternalEnum() {}
shared_ptr<BuildingObject> IfcInternalOrExternalEnum::getDeepCopy( BuildingCopyOptions& options )
{
	shared_ptr<IfcInternalOrExternalEnum> copy_self( new IfcInternalOrExternalEnum() );
	copy_self->m_enum = m_enum;
	return copy_self;
}
void IfcInternalOrExternalEnum::getStepParameter( std::stringstream& stream, bool is_select_type ) const
{
	if( is_select_type ) { stream << "IFCINTERNALOREXTERNALENUM("; }
	switch( m_enum )
	{
		case ENUM_INTERNAL:	stream << ".INTERNAL."; break;
		case ENUM_EXTERNAL:	stream << ".EXTERNAL."; break;
		case ENUM_EXTERNAL_EARTH:	stream << ".EXTERNAL_EARTH."; break;
		case ENUM_EXTERNAL_WATER:	stream << ".EXTERNAL_WATER."; break;
		case ENUM_EXTERNAL_FIRE:	stream << ".EXTERNAL_FIRE."; break;
		case ENUM_NOTDEFINED:	stream << ".NOTDEFINED."; break;
	}
	if( is_select_type ) { stream << ")"; }
}
const std::wstring IfcInternalOrExternalEnum::toString() const
{
	switch( m_enum ) 
	{
		case ENUM_INTERNAL:	return L"INTERNAL";
		case ENUM_EXTERNAL:	return L"EXTERNAL";
		case ENUM_EXTERNAL_EARTH:	return L"EXTERNAL_EARTH";
		case ENUM_EXTERNAL_WATER:	return L"EXTERNAL_WATER";
		case ENUM_EXTERNAL_FIRE:	return L"EXTERNAL_FIRE";
		case ENUM_NOTDEFINED:	return L"NOTDEFINED";
	}
	return L"";
}
shared_ptr<IfcInternalOrExternalEnum> IfcInternalOrExternalEnum::createObjectFromSTEP( const std::wstring& arg, const std::map<int,shared_ptr<BuildingEntity> >& map )
{
	if( arg.compare( L"$" ) == 0 ) { return shared_ptr<IfcInternalOrExternalEnum>(); }
	if( arg.compare( L"*" ) == 0 ) { return shared_ptr<IfcInternalOrExternalEnum>(); }
	shared_ptr<IfcInternalOrExternalEnum> type_object( new IfcInternalOrExternalEnum() );
	if( boost::iequals( arg, L".INTERNAL." ) )
	{
		type_object->m_enum = IfcInternalOrExternalEnum::ENUM_INTERNAL;
	}
	else if( boost::iequals( arg, L".EXTERNAL." ) )
	{
		type_object->m_enum = IfcInternalOrExternalEnum::ENUM_EXTERNAL;
	}
	else if( boost::iequals( arg, L".EXTERNAL_EARTH." ) )
	{
		type_object->m_enum = IfcInternalOrExternalEnum::ENUM_EXTERNAL_EARTH;
	}
	else if( boost::iequals( arg, L".EXTERNAL_WATER." ) )
	{
		type_object->m_enum = IfcInternalOrExternalEnum::ENUM_EXTERNAL_WATER;
	}
	else if( boost::iequals( arg, L".EXTERNAL_FIRE." ) )
	{
		type_object->m_enum = IfcInternalOrExternalEnum::ENUM_EXTERNAL_FIRE;
	}
	else if( boost::iequals( arg, L".NOTDEFINED." ) )
	{
		type_object->m_enum = IfcInternalOrExternalEnum::ENUM_NOTDEFINED;
	}
	return type_object;
}
